nightlink

0.1.0 • Public • Published

Nightlink

Start and control a Tor instance.

Install

$ npm install --save nightlink

Usage

Basic

const nightlink = require('nightlink');
 
const tor = await nightlink.launch({
  SocksPort: 9050
});
 
// Tor has started and connected to the network.
 
await tor.close();

Logs

tor.on('log', {level, msg} => {
  console.log(`[${level}${msg}`);
})

Logs by level

tor.on('notice', console.log);
tor.on('warn', console.log);
tor.on('err', console.error);

Examples

API

nightlink.launch([options])

options

Type: object

Define options to be used.

SocksPort

Type: Number

Define port Tor should start the SOCKS proxy on.

.close()

.on('log', callback)

.on('notice', callback)

.on('warn', callback)

.on('err', callback)

Licence

MIT © Ben Evans

Package Sidebar

Install

npm i nightlink

Weekly Downloads

3

Version

0.1.0

License

MIT

Last publish

Collaborators

  • bencevans