wallet-core/node_modules/get-port
2017-05-28 00:40:43 +02:00
..
index.js add linting (and some initial fixes) 2017-05-28 00:40:43 +02:00
license add linting (and some initial fixes) 2017-05-28 00:40:43 +02:00
package.json add linting (and some initial fixes) 2017-05-28 00:40:43 +02:00
readme.md add linting (and some initial fixes) 2017-05-28 00:40:43 +02:00

get-port Build Status

Get an available port

Install

$ npm install --save get-port

Usage

const getPort = require('get-port');

getPort().then(port => {
	console.log(port);
	//=> 51402
});

Optionally, pass in a preferred port:

getPort(3000).then(port => {
	console.log(port);
	// Will use 3000 if available, otherwise fall back to a random port
});

License

MIT © Sindre Sorhus