eaptain-getport
TypeScript icon, indicating that this package has built-in type declarations

3.1.1 • Public • Published

get-port Build Status

Get an available port

Install

$ npm install --save get-port

Usage

const getPort = require('get-port');
 
getPort().then(port => {
    console.log(port);
    //=> 51402
});

Optionally, pass in a preferred port:

getPort(3000).then(port => {
    console.log(port);
    // Will use 3000 if available, otherwise fall back to a random port
});

Related

License

MIT © Sindre Sorhus

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.1.1
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.1.1
    10

Package Sidebar

Install

npm i eaptain-getport

Weekly Downloads

10

Version

3.1.1

License

MIT

Last publish

Collaborators

  • cavacn