Find a new port that's available to be used in your program.
$ npm install newport
var newport = require('newport')
// Get a new port that is available
newport(function(err, port){
if (err) throw err
console.log(port)
})
// Check if a port is available
newport(8080, function(err, port){
if (err) throw err
console.log(port)
})
The MIT License
Copyright (c) 2015 Montana Flynn http://anonfunction.com