UNPKG

496 BMarkdownView Raw
1# get-port [![Build Status](https://travis-ci.org/sindresorhus/get-port.svg?branch=master)](https://travis-ci.org/sindresorhus/get-port)
2
3> Get an available port
4
5
6## Install
7
8```
9$ npm install --save get-port
10```
11
12
13## Usage
14
15```js
16const getPort = require('get-port');
17
18getPort().then(port => {
19 console.log(port);
20 //=> 51402
21});
22```
23
24
25## Related
26
27- [get-port-cli](https://github.com/sindresorhus/get-port-cli) - CLI for this module
28
29
30## License
31
32MIT © [Sindre Sorhus](http://sindresorhus.com)