eport
Find a free port
Install
Install this package with npm
, if you have not install NodeJs
or npm
, you should install that first.
npm install eport --save-dev
Just run this commands to install eport for your project.
Usage
var eport = ; ;
Method
require('eport')([host], callback);
- [host] A hostname or ip address that it will listen to.
- callback(error, port) A hostname or ip address that it will listen to.
- callback.error
object
throws error - callback.port
number
a free port.
- callback.error
Example 1
; // without host;
Example 2
// Set a random port for livereload; grunt;