Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yosuke-furukawa/plz-port
https://github.com/yosuke-furukawa/plz-port
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/yosuke-furukawa/plz-port
- Owner: yosuke-furukawa
- Created: 2016-05-25T01:37:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T20:28:37.000Z (11 months ago)
- Last Synced: 2024-09-25T21:50:27.227Z (about 2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
plz-port
============
[![npm version](https://badge.fury.io/js/plz-port.svg)](https://badge.fury.io/js/plz-port)
[![Build Status](https://travis-ci.org/yosuke-furukawa/plz-port.svg?branch=master)](https://travis-ci.org/yosuke-furukawa/plz-port)
[![Coverage Status](https://coveralls.io/repos/github/yosuke-furukawa/plz-port/badge.svg?branch=master)](https://coveralls.io/github/yosuke-furukawa/plz-port?branch=master)please give me any port if the port is opened.
```javascript
const plzPort = require('plz-port');plzPort().then((port) => {
assert(port >= 3000); // random port range is 3000 < 65535
assert(port <= 65535);
});plzPort(3000).then((port) => {
console.log(port); // 3000 if the port is opened.
});plzPort(8080).then((port) => {
console.log(port); // 8081, 8082, 8083.... increment the port until found open port
});
```