JSPM

  • Created
  • Published
  • Downloads 11903358
  • Score
    100M100P100Q221451F

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

Package Exports

  • portfinder

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (portfinder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-portfinder

Installation

Installing npm (node package manager)

  curl http://npmjs.org/install.sh | sh

Installing node-portfinder

  $ [sudo] npm install portfinder

Usage

The portfinder module has a simple interface:

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

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

Run Tests

  $ npm test

Author: Charlie Robbins