Gathering detailed insights and metrics for port-used
Gathering detailed insights and metrics for port-used
Gathering detailed insights and metrics for port-used
Gathering detailed insights and metrics for port-used
tcp-port-used
A simple Node.js module to check if a TCP port is already bound.
@types/tcp-port-used
TypeScript definitions for tcp-port-used
happn-tcp-port-used
A simple Node.js module to check if a TCP port is already bound.
brotli
A port of the Brotli compression algorithm as used in WOFF2
A Node.js module to check if a TCP port is already bound.
npm install port-used
Typescript
Module System
Node Version
NPM Version
72.9
Supply Chain
98.9
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
5,347,457
Last Day
9
Last Week
678
Last Month
3,393
Last Year
254,276
MIT License
1 Stars
81 Commits
1 Watchers
56 Branches
1 Contributors
Updated on Jul 25, 2021
Minified
Minified + Gzipped
Latest Version
2.0.8
Package Id
port-used@2.0.8
Unpacked Size
30.91 kB
Size
5.96 kB
File Count
13
NPM Version
6.1.0
Node Version
10.5.0
Cumulative downloads
Total Downloads
Last Day
-83%
9
Compared to previous day
Last Week
-16.4%
678
Compared to previous week
Last Month
-77.6%
3,393
Compared to previous month
Last Year
-44.6%
254,276
Compared to previous year
1
A Node.js module to check if a TCP port is currently in use. It returns a promise. Based on tcp-port-used
npm install port-used
To check a port's state:
1var portUsed = require('port-used'); 2 3portUsed.check(44201, '127.0.0.1') 4.then((inUse) => { 5 console.log('Port 44201 usage: '+inUse); 6}, (err) => { 7 console.error('Error on check:', err.message); 8});
To wait until a port on a host is available:
1portUsed.waitUntilFree({ 2 port: 44203, 3 host: 'some.host.com', 4 retryTime: 500, 5 timeout: 4000, 6}).then(() => { 7 console.log('Port 44203 on some.host.com is now free.'); 8}, (err) => { 9 console.log('Error:', err.message); 10});
To wait until a port on a host is accepting connections:
1portUsed.waitUntilUsed({ 2 port: 44204, 3 host: 'some.host.com', 4 retryTime: 500, 5 timeout: 4000, 6}).then(() => { 7 console.log('Port 44204 on some.host.com is now in use.'); 8}, (err) => { 9 console.log('Error:', err.message); 10});
To wait until a port on a host is in specific state:
1portUsed.waitForStatus({ 2 port: 44204, 3 host: 'some.host.com', 4 inUse: true, 5 retryTime: 500, 6 timeout: 4000, 7}).then(() => { 8 console.log('Port 44204 on some.host.com is now in use.'); 9}, (err) => { 10 console.log('Error:', err.message); 11});
Checks if a TCP port is in use by attempting to connect to the port on host.
If no host is specified, the module uses '127.0.0.1' (localhost). When the
promise is resolved, there is a parameter inUse
, when true means the port is
in use and false means the port is free.
Parameters:
Returns:
Promise A promise.
Returns a promise and fulfills it only when the host's socket is free. Will retry on an interval specified in retryTime until the timeout. If not defined the retryTime is 250 ms and the timeout is 2000 ms. If the host is not defined, the modules uses the default '127.0.0.1'.
Parameters:
Returns:
Promise A promise.
Returns a promise and fulfills it only when the socket is accepting connections. Will retry on an interval specified in retryTime until the timeout. If not defined, the retryTime is 250 ms and the timeout is 2000 ms. If the host is not defined the module uses the default '127.0.0.1'.
Parameters:
Returns:
Promise A promise.
Waits until the port on host matches the boolean status in terms of use. If the status is true, the promise defers until the port is in use. If the status is false the promise defers until the port is free. If the host is undefined or null, the module uses the default '127.0.0.1'. Also, if not defined the retryTime is 250 ms and the timeout is 2000 ms.
Parameters:
Returns:
Promise A promise.
The MIT License (MIT)
Copyright (c) 2018 oculus42
Copyright (c) 2013 jut-io (stdarg)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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