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.
- Host: GitHub
- URL: https://github.com/ratson/connect-port
- Owner: ratson
- Created: 2017-06-25T11:35:09.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-01T08:43:51.000Z (almost 8 years ago)
- Last Synced: 2025-01-30T22:51:25.556Z (over 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.