plz-port

1.0.0 • Public • Published

plz-port

npm version Build Status Coverage Status

please give me any port if the port is opened.

const plzPort = require('plz-port');
 
plzPort().then((port) => {
  assert(port >= 3000); // random port range is 3000 < 65535
  assert(port <= 65535);
});
 
plzPort(3000).then((port) => {
  console.log(port); // 3000 if the port is opened.
});
 
plzPort(8080).then((port) => {
  console.log(port); // 8081, 8082, 8083.... increment the port until found open port
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

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

Package Sidebar

Install

npm i plz-port

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • yosuke-furukawa