get-multiple-ports

2.0.0 • Public • Published

get-multiple-ports

Get a number of (optionally named) available ports.

usage

const ports = require(`get-multiple-ports`)
 
ports()
.then(console.log)
.catch(console.error)
// [ 58021 ]
 
ports(3)
.then(console.log)
.catch(console.error)
// [ 57883, 57884, 57885 ]
 
ports(`protostar`)
.then(console.log)
.catch(console.error)
// { protostar: 58016 }
 
ports([ `ControlPort`, `SocksPort` ])
.then(console.log)
.catch(console.error)
// { ControlPort: 57889, SocksPort: 57890 }

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    7
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    7
  • 1.0.0
    2

Package Sidebar

Install

npm i get-multiple-ports

Weekly Downloads

3

Version

2.0.0

License

MIT

Last publish

Collaborators

  • rogerbf