Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrelmlins/choose-port
Choose an available port
https://github.com/andrelmlins/choose-port
choose choose-port host port server
Last synced: 1 day ago
JSON representation
Choose an available port
- Host: GitHub
- URL: https://github.com/andrelmlins/choose-port
- Owner: andrelmlins
- License: mit
- Created: 2020-02-06T11:30:53.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-06T20:29:12.000Z (over 4 years ago)
- Last Synced: 2024-11-07T23:58:12.725Z (10 days ago)
- Topics: choose, choose-port, host, port, server
- Language: JavaScript
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Choose Port
Choose an available port
[![npm version](https://badge.fury.io/js/choose-port.svg)](https://www.npmjs.com/package/choose-port) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/andrelmlins/choose-port/blob/master/LICENSE) [![Build Status](https://travis-ci.com/andrelmlins/choose-port.svg?branch=master)](https://travis-ci.com/andrelmlins/choose-port) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/andrelmlins/choose-port.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/andrelmlins/choose-port/context:javascript)
## Install
```
npm install choose-port
```or
```
yarn add choose-port
```## Usage
**Call Async**
```js
const choosePort = require('choose-port');choosePort(8000, '127.0.0.1', portValid => {
console.log('Chosen port:', portValid);
});
```**Call Sync**
```js
const { choosePortSync } = require('choose-port');const portValid = choosePortSync(8000, '127.0.0.1');
console.log(portValid);
```## NPM Statistics
Download stats for this NPM package
[![NPM](https://nodei.co/npm/choose-port.png)](https://nodei.co/npm/choose-port/)
## License
Choose Port is open source software [licensed as MIT](https://github.com/andrelmlins/choose-port/blob/master/LICENSE).