保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 9bdb95c9e34cef640534e5e5a1e2225a80442000
PAMapp/node_modules/get-port-please/README.md
@@ -18,13 +18,17 @@
```
```js
const { getPort } = require('get-port-please')
// or
import { getPort } from 'get-port-please'
// ESM
import { getPort, checkPort, getRandomPort, waitForPort } from 'get-port-please'
// CommonJS
const { getPort, checkPort, getRandomPort, waitForPort } = require('get-port-please')
```
```ts
function getPort(options?: GetPortOptions): Promise<number>
getPort(options?: GetPortOptions): Promise<number>
checkPort(port: number, host?: string): Promise<number | false>
waitForPort(port: number, options): Promise<number | false>
```
Try sequence is: port > ports > memo > random
@@ -37,6 +41,7 @@
  random?: boolean
  port?: number
  portRange?: [from: number, to: number]
  ports?: number[]
  host?: string
@@ -59,11 +64,15 @@
### `ports`
Alternative ports to check. Default is `[4000, 5000, 6000, 7000]`
Alternative ports to check.
### `portRange`
Alternative port range to check. Deefault is `[3000,3100]`
### `host`
The host to check. Default is `process.env.HOST || '0.0.0.0'`
The host to check. Default is `process.env.HOST` otherwise all available hosts will be checked.
### `memoDir` / `memoName`