0.2.0 • Published 11 years ago

findandbind v0.2.0

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

Find and bind

Find a free port to which to bind.

var app = restify.createServer();

// ... do my configuration of app

require('findandbind')(app, function (err, port) {
    console.log('listening on', port);
});

By default, findandbind starts checking at 1024, the first user port. To start checking at a different port:

require('findandbind')(app, { start: 2048 }, function (err, port) {
    console.log('listening on', port);
});