An open API service indexing awesome lists of open source software.

https://github.com/ratson/connect-port

Resolve a promise when successfully connected to remote port.
https://github.com/ratson/connect-port

Last synced: about 1 year ago
JSON representation

Resolve a promise when successfully connected to remote port.

Awesome Lists containing this project

README

          

# connect-port

Resolve a promise when successfully connected to remote port.

## Installation

```
npm install connect-port --save
```

## Usage

```js
const connectPort = require('connect-port')

connectPort(80, {
host: 'npmjs.com',
}).then(socket => {
console.log(socket.connecting)
})
// false
```

## Related

- [port-ready](https://github.com/ratson/port-ready) - Promise to wait until a port is ready to accept connection.