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
Typescript
Module System
Node Version
NPM Version
TypeScript (99.3%)
JavaScript (0.7%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
287 Stars
167 Commits
14 Forks
3 Watchers
1 Branches
26 Contributors
Updated on Jul 14, 2025
Latest Version
3.2.0
Package Id
get-port-please@3.2.0
Unpacked Size
28.49 kB
Size
5.94 kB
File Count
8
NPM Version
10.9.2
Node Version
22.14.0
Published on
Jul 11, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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 getSocketAddress, 8 isSocketSupported, 9 cleanSocket 10} from "get-port-please"; 11 12// CommonJS 13const { 14 getPort, 15 checkPort, 16 getRandomPort, 17 waitForPort, 18 getSocketAddress, 19 isSocketSupported, 20 cleanSocket 21} = require("get-port-please");
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 > 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 binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
Found 6/26 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
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 2025-07-07
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