port-fallback

1.0.0 • Public • Published

port-fallback

Start a server on an available port. Tries a random higher port if the requested port is taken.

NPM version Build Status

Getting Started

var portFallback = require('port-fallback'),
    http = require('http'),
    defaultPort = 4000,
    server = http.createServer()
 
portFallback.listen(server,
  {defaultPort: defaultPort},
  function(err, port) {
    console.log("Listening on "+port)
    // ...
  }
)

Readme

Keywords

Package Sidebar

Install

npm i port-fallback

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hurrymaplelad