Gathering detailed insights and metrics for get-port-please
Gathering detailed insights and metrics for get-port-please
Gathering detailed insights and metrics for get-port-please
Gathering detailed insights and metrics for get-port-please
npm install get-port-please
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
259 Stars
157 Commits
14 Forks
4 Watching
7 Branches
22 Contributors
Updated on 27 Nov 2024
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
0.7%
325,415
Compared to previous day
Last week
3.8%
1,693,461
Compared to previous week
Last month
6.9%
7,209,200
Compared to previous month
Last year
107.1%
72,609,598
Compared to previous year
Get an available TCP port to listen
Install package:
1npm i get-port-please
1// ESM 2import { 3 getPort, 4 checkPort, 5 getRandomPort, 6 waitForPort, 7} from "get-port-please"; 8 9// CommonJS 10const { 11 getPort, 12 checkPort, 13 getRandomPort, 14 waitForPort, 15} = require("get-port-please");
1getPort(options?: GetPortOptions): Promise<number>
2checkPort(port: number, host?: string): Promise<number | false>
3waitForPort(port: number, options): Promise<number | false>
Try sequence is: port > ports > random
1interface GetPortOptions { 2 name?: string; 3 4 random?: boolean; 5 port?: number; 6 portRange?: [fromInclusive: number, toInclusive: number]; 7 ports?: number[]; 8 host?: string; 9 10 memoDir?: string; 11 memoName?: string; 12}
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
Extended ports to check.
portRange
Extended port range to check.
The range's start and end are inclusive, i.e. it is [start, end]
in the mathematical notion.
Reversed port ranges are not supported. If start > end
, then an empty range will be returned.
alternativePortRange
Alternative port range to check as fallback when none of the ports are available.
The range's start and end are inclusive, i.e. it is [start, end]
in the mathematical notion.
Reversed port ranges are not supported. If start > end
, then an empty range will be returned.
The default range is [3000, 3100]
(only when port
is unspecified).
host
The host to check. Default is process.env.HOST
otherwise all available hosts will be checked.
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/26 approved changesets -- score normalized to 1
Reason
9 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More