Gathering detailed insights and metrics for detect-port-alt
Gathering detailed insights and metrics for detect-port-alt
Gathering detailed insights and metrics for detect-port-alt
Gathering detailed insights and metrics for detect-port-alt
Node.js module to detect available ports of the system.
npm install detect-port-alt
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.8
Supply Chain
100
Quality
77.3
Maintenance
100
Vulnerability
100
License
TypeScript (86.2%)
JavaScript (13.8%)
Total Downloads
1,409,281,674
Last Day
279,879
Last Week
4,387,670
Last Month
19,141,353
Last Year
215,347,430
MIT License
389 Stars
90 Commits
25 Forks
14 Watchers
2 Branches
28 Contributors
Updated on May 26, 2025
Minified
Minified + Gzipped
Latest Version
1.1.6
Package Id
detect-port-alt@1.1.6
Size
25.87 kB
NPM Version
5.7.1
Node Version
8.9.1
Published on
Apr 03, 2018
Cumulative downloads
Total Downloads
Last Day
-16.4%
279,879
Compared to previous day
Last Week
-12.1%
4,387,670
Compared to previous week
Last Month
5.2%
19,141,353
Compared to previous month
Last Year
-5.2%
215,347,430
Compared to previous year
6
JavaScript Implementation of Port Detector
1$ npm i detect-port --save
1const detect = require('detect-port'); 2 3/** 4 * callback usage 5 */ 6 7detect(port, (err, _port) => { 8 if (err) { 9 console.log(err); 10 } 11 12 if (port == _port) { 13 console.log(`port: ${port} was not occupied`); 14 } else { 15 console.log(`port: ${port} was occupied, try port: ${_port}`); 16 } 17}); 18 19/** 20 * for a yield syntax instead of callback function implement 21 */ 22 23const co = require('co'); 24 25co(function *() { 26 const _port = yield detect(port); 27 28 if (port == _port) { 29 console.log(`port: ${port} was not occupied`); 30 } else { 31 console.log(`port: ${port} was occupied, try port: ${_port}`); 32 } 33}); 34 35/** 36 * use as a promise 37 */ 38 39detect(port) 40 .then(_port => { 41 if (port == _port) { 42 console.log(`port: ${port} was not occupied`); 43 } else { 44 console.log(`port: ${port} was occupied, try port: ${_port}`); 45 } 46 }) 47 .catch(err => { 48 console.log(err); 49 }); 50
1$ npm i detect-port -g
1# get an available port randomly 2$ detect 3 4# detect pointed port 5$ detect 80 6 7# more help 8$ detect --help
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/30 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 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
detected GitHub workflow tokens with excessive permissions
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-06-30
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