Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

portfinder

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

portfinder - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

.travis.yml

31

lib/portfinder.js

@@ -11,2 +11,3 @@ /*

path = require('path'),
async = require('async'),
mkdirp = require('mkdirp').mkdirp;

@@ -72,2 +73,32 @@

//
// ### function getPorts (count, options, callback)
// #### @count {Number} The number of ports to find
// #### @options {Object} Settings to use when finding the necessary port
// #### @callback {function} Continuation to respond to when complete.
// Responds with an array of unbound ports on the current machine.
//
exports.getPorts = function (count, options, callback) {
if (!callback) {
callback = options;
options = {};
}
var lastPort = null;
async.timesSeries(count, function(index, asyncCallback) {
if (lastPort) {
options.port = exports.nextPort(lastPort);
}
exports.getPort(options, function (err, port) {
if (err) {
asyncCallback(err);
} else {
lastPort = port;
asyncCallback(null, port);
}
});
}, callback);
};
//
// ### function getSocket (options, callback)

@@ -74,0 +105,0 @@ // #### @options {Object} Settings to use when finding the necessary port

10

package.json
{
"name": "portfinder",
"version": "0.3.0",
"version": "0.4.0",
"description": "A simple tool to find an open port on the current machine",

@@ -12,12 +12,12 @@ "author": "Charlie Robbins <charlie.robbins@gmail.com>",

"dependencies": {
"mkdirp": "0.0.x"
"async": "0.9.0",
"mkdirp": "0.5.x"
},
"devDependencies": {
"async": "0.1.x",
"vows": "0.5.x"
"vows": "0.8.0"
},
"main": "./lib/portfinder",
"scripts": { "test": "vows test/*-test.js --spec" },
"engines": { "node": ">= 0.4.0" },
"engines": { "node": ">= 0.8.0" },
"license": "MIT/X11"
}

@@ -1,2 +0,2 @@

# node-portfinder
# node-portfinder [![Build Status](https://api.travis-ci.org/indexzero/node-portfinder.svg)](https://travis-ci.org/indexzero/node-portfinder)

@@ -20,6 +20,6 @@ ## Installation

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

@@ -39,2 +39,2 @@ //

#### License: MIT/X11
[0]: http://nodejitsu.com
[0]: http://nodejitsu.com
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc