portfinder

A simple tool to find an open port on the current machine

node-portfinder

  curl http://npmjs.org/install.sh | sh
  $ [sudo] npm install portfinder

The portfinder module has a simple interface:

  var portfinder = require('portfinder');
 
  portfinder.getPort(function (errport) {
    // 
    // `port` is guaranteed to be a free port 
    // in this scope. 
    // 
  });

By default portfinder will start searching from 8000. To change this simply set portfinder.basePort.

  $ npm test

Author: Charlie Robbins