New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

getports

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getports

Find multiple open ports to listen on.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

getports

Build Status

Find multiple open ports to listen on. It's getport for multiple ports. Calling vanilla getport in parallel will return the same open port, requiring you to utilize the port after each callback, before calling getport again, which is what getports does.

getports(num, opts, function (err, ports) {})

getports(3, function onPorts(error, ports) {
  if (error) throw error;

  server.listen(ports[0]);
  server.listen(ports[1]);
  server.listen(ports[2]);
});
  • opts.start [optional] - first port to try
  • opts.last [optional] - last port to try

License

MIT

Keywords

port

FAQs

Package last updated on 04 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts