get-next-port
v1.0.1
Published
Get next available port number.
Downloads
3
Readme
get-next-port
Get next available port.
Install
$ npm install --save get-next-port
Usage
const getNextPort = require('get-next-port');
getNextPort().then(port => {
console.log(port);
// => 8081
});
Or you can pass in a port :
const getNextPort = require('get-next-port');
getNextPort(8000).then(port => {
console.log(port);
// will return if 8000 is available
// otherwise increase port number by 1 until find the available port
});
Related
- get-port - Based on this module
License
MIT © Yi-Wen Lin