# porty

> Porty quickly and easily find available ports.

Latest version **3.1.1** (published 2017-11-12) · MPL-2.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2017-11-12 |
| First published | 2016-11-28 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | separate (@types/porty) |
| Module format | CommonJS |
| Node | >=7.6.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Alexander Elias |
| Maintainers | alexanderelias |
| Keywords | port, finder, tester, find, test, porty, ports, available |

## Links

- npm: https://www.npmjs.com/package/porty
- Repository: https://github.com/AlexanderElias/porty
- Homepage: https://github.com/AlexanderElias/porty#readme
- Issues: https://github.com/AlexanderElias/porty/issues
- npm.io page: https://npm.io/package/porty

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 3.1.1 (latest) — 2017-11-12
- 3.1.0 — 2017-11-12
- 3.0.0 — 2017-11-10
- 2.0.0 — 2017-06-12
- 1.0.2 — 2016-11-28
- 1.0.1 — 2016-11-28
- 1.0.0 — 2016-11-28

## README

# Porty
Porty quickly and easily find available ports.

## Install
`npm i porty --save`

## Example

```js
const port = await Porty.find({
	min: 8080,
	max: 8090,
	avoids: [8081, 8080, 8082, 8083, 8084]
});

console.log(port); // 8085
```

## Porty.test(port)
Tests if a port is in use. Returns a boolean.
- `port: Number` port to test

## Porty.find([options,] [min, max, avoids])
Arguments can be a single object or one/two number arguments. All arguments are optional. Return value is a open port number `>= min <= max`.

- `options: Object`
	- `min: Number` port number to start (default: 8,000)
	- `max: Number` port number to end (default: 10,000)
	- `avoids: Array` array of port numbers to avoid
- `min: Number`
- `max: Number`
- `avoids: Array`

## Porty.get
Alias for Porty.find

## Authors
[AlexanderElias](https://github.com/AlexanderElias)

## License
[Why You Should Choose MPL-2.0](http://veldstra.org/2016/12/09/you-should-choose-mpl2-for-your-opensource-project.html)
This project is licensed under the MPL-2.0 License

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