# tcp-connect

> Check if host and port is available.

Latest version **0.0.5** (published 2026-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install tcp-connect
pnpm add tcp-connect
yarn add tcp-connect
bun add tcp-connect
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2026-04-15 |
| First published | 2016-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Johan Dewe |
| Maintainers | dewe |
| Keywords | tcp, nodejs, connection |

## Links

- npm: https://www.npmjs.com/package/tcp-connect
- Repository: https://github.com/dewe/tcp-connect
- Homepage: https://github.com/dewe/tcp-connect#readme
- Issues: https://github.com/dewe/tcp-connect/issues
- npm.io page: https://npm.io/package/tcp-connect

## Recent versions

- 0.0.5 (latest) — 2026-04-15
- 0.0.4 — 2025-11-25
- 0.0.3 — 2016-04-12
- 0.0.1 — 2016-04-11

## README

# tcp-connect

Check if a TCP port is reachable. Returns connection time in milliseconds.

## Usage

```javascript
var tcp = require('tcp-connect');

tcp(google.com, 80, 1000)
  .then(() => console.log('google.com is available'))
  .catch(() => console.log('no luck this time'));
```

## Development

Tests are best run in docker:

```shell
docker-compose run tcp-connect npm test
```

---
_Source: https://npm.io/package/tcp-connect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
