# portchecker

> a simple tcp port checker for node

Latest version **0.1.2** (published 2013-04-05) · 0 weekly downloads

## Install

```sh
npm install portchecker
pnpm add portchecker
yarn add portchecker
bun add portchecker
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2013-04-05 |
| First published | 2011-11-23 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ~0.8.5 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | danielzzz |
| Maintainers | danielzzz |

## Links

- npm: https://www.npmjs.com/package/portchecker
- Repository: https://github.com/danielzzz/node-portchecker
- Homepage: http://github.com/danielzzz/node-portchecker
- npm.io page: https://npm.io/package/portchecker

## Recent versions

- 0.1.2 (latest) — 2013-04-05
- 0.1.1 — 2012-11-03
- 0.1.0 — 2011-11-23

## README

NODE-PORTCHECKER
A simple tcp port checker for node

LICENSE MIT
(C) Daniel Zelisko
http://github.com/danielzzz/node-portchecker

DESCRIPTION
This library allows for easy and simple tcp port checking. 
It can be used for determining if a given port is open, or to find a first available port

INSTALLATION:
npm install portchecker

API:
getFirstAvailable(startPort, endPort, host, cb)
returns first available port in a given range cb(port, host)

getAllOpen(startPort, endPort, host, cb)
returns array of available ports for a given hosts in a given range cb(openPorts, host)

isOpen(port, host, callback)
returns true if a given host:port is open cb(isOpen, port, host)

setTimeout(milisecs)
configure timeout for port probing (default 400 milisecs)


EXAMPLE:

//find first available port between 80 and 90 on localhost
portchecker.getFirstAvailable(80, 90, 'localhost', function(p, host) { console.log(host+":"+p+" is free");});

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