HEX
Server: Apache/2.4.6 () PHP/7.4.33
System: Linux chile-dev-app-1 5.4.17-2136.315.5.el7uek.x86_64 #2 SMP Wed Dec 21 19:57:57 PST 2022 x86_64
User: apache (48)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //lib/node_modules/serve/node_modules/is-port-reachable/readme.md
# is-port-reachable

> Check if a local or remote port is reachable

## Install

```sh
npm install is-port-reachable
```

## Usage

```js
import isPortReachable from 'is-port-reachable';

console.log(await isPortReachable(80, {host: 'google.com'}));
//=> true
```

## API

### isPortReachable(options)

Returns `Promise<boolean>` for whether the port is reachable.

##### port

Type: `number`

The port to check.

#### options

Type: `object`

##### host

**Required**\
Type: `string`\
Example: `'localhost'`

The host to check.

Can be a domain (optionally, with a sub-domain) or an IP address.

##### timeout

Type: `number`\
Default: `1000`

The time to wait in milliseconds before giving up.

## Related

- [is-reachable](https://github.com/sindresorhus/is-reachable/) - Check if servers are reachable