# get-next-port

> Get next available port number.

Latest version **1.0.1** (published 2017-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-next-port
pnpm add get-next-port
yarn add get-next-port
bun add get-next-port
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-05-21 |
| First published | 2017-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yi-Wen Lin |
| Maintainers | yiwenl |
| Keywords | get, port, next, available |

## Links

- npm: https://www.npmjs.com/package/get-next-port
- Repository: https://yiwenl@github.com/yiwenl/get-next-port
- Homepage: https://github.com/yiwenl/get-next-port#readme
- Issues: https://github.com/yiwenl/get-next-port/issues
- npm.io page: https://npm.io/package/get-next-port

## Dependencies (1)

- [get-port](https://npm.io/package/get-port.md) ^3.1.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-05-21
- 1.0.0 — 2017-05-21

## README

# get-next-port [![Build Status](https://travis-ci.org/yiwenl/get-next-port.svg?branch=master)](https://travis-ci.org/yiwenl/get-next-port)

Get next available port.

## Install

```
$ npm install --save get-next-port
```


## Usage
```js
const getNextPort = require('get-next-port');

getNextPort().then(port => {
	console.log(port);
	// => 8081
});

```

Or you can pass in a port :

```js
	const getNextPort = require('get-next-port');

	getNextPort(8000).then(port => {
		console.log(port);
		// will return if 8000 is available
		// otherwise increase port number by 1 until find the available port	
	});
```


## Related

- [get-port](https://github.com/sindresorhus/get-port) - Based on this module


## License

MIT © [Yi-Wen Lin](https://yiwenl.github.io/)

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