0.1.0 • Published 6 years ago

nightlink v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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