portscanner-plus
Get multiple available ports with optional names
Last updated 11 years ago by shakyshane .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install portscanner-plus 
SYNC missed versions from official npm registry.

#portscanner-plus Build Status

Get multiple availble ports within a range - with optional naming

##Install

npm install portscanner-plus --save-dev

##Usage

var portScanner = require("./lib/index");

var names = ['controlPanel', 'socket', 'client'];

// Return named ports as object
portScanner.getPorts(3, 3000, 4000, names).then(function (ports) {
    console.log(ports.controlPanel); // 3000
    console.log(ports.socket); // 3001
    console.log(ports.client); // 3002
});

// Return an array of ports
portScanner.getPorts(2, 3000, 4000).then(function (ports) {
    console.log(ports); // [3001, 3002]
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

License

Copyright (c) 2013 Shane Osbourne Licensed under the MIT license.

Current Tags

  • 0.2.1                                ...           latest (10 years ago)

6 Versions

  • 0.2.1                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.3                                ...           11 years ago
  • 0.0.2                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (9)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE