You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() |
2 years ago | |
---|---|---|
.. | ||
index.js | 2 years ago | |
license | 2 years ago | |
package.json | 2 years ago | |
readme.md | 2 years ago |
readme.md
is-port-reachable 
Check if a local or remote port is reachable
Install
$ npm install is-port-reachable
Usage
const isPortReachable = require('is-port-reachable');
(async () => {
console.log(await isPortReachable(80, {host: 'google.com'}));
//=> true
})();
API
isPortReachable(port, [options])
Returns Promise<boolean>
.
port
Type: number
options
Type: Object
host
Type: string
Default: localhost
Can be a domain or an IP.
timeout
Type: number
Default: 1000
Milliseconds to wait before giving up.
Related
- is-reachable - Check if servers are reachable
License
MIT © Sindre Sorhus