get-port-plz
Get an available TCP port to listen
Usage
Install package:
yarn add get-port-plz# or or npm install get-port-plz
const getPort = // or
Try sequence is: port > ports > memo > random
Options
name
Unique name for port memorizing. Default is default
.
random
If enabled, port
and ports
will be ignored. Default is false
.
port
First port to check. Default is process.env.PORT || 3000
ports
Alternative ports to check. Default is [4000, 5000, 6000, 7000]
memoDir
/ memoName
Options passed to fs-memo
- Default dir:
node_modules/get-port/dist
- Defalt name:
.get-port
License
MIT