An open API service indexing awesome lists of open source software.

https://github.com/karimsa/next-port

grab next available TCP port.
https://github.com/karimsa/next-port

Last synced: 3 months ago
JSON representation

grab next available TCP port.

Awesome Lists containing this project

README

        

# next-port

grab next available port.

## usage

```javascript
var nextPort = require('next-port')

// simple usage; check all ports
// (only check <=1024 if root/admin)
nextPort(function (err, port) { /* ... */ })

// specify some options
nextPort({ /* options */ }, function (err, port) { /* ... */ })
```

## options

- `lower`: the lower bound to start scan from. (default: 1 if root/admin, 1024 if not)
- `higher`: the higher bound to stop scan at. (default: 65535)
- `protocol`: TCP or UDP.