detect-port
Advanced tools
Comparing version 1.2.2 to 1.2.3
1.2.3 / 2018-05-16 | ||
================== | ||
**features** | ||
* [[`17ffc37`](http://github.com/node-modules/detect-port/commit/17ffc37af8029f9744c885ebbb28dc2f19e587dd)] - feat: update contributor (xudafeng <<xudafeng@126.com>>) | ||
**fixes** | ||
* [[`64777f8`](http://github.com/node-modules/detect-port/commit/64777f85cc519c9c4c2c84c23d2afed6a916f3c4)] - fix: ignore EADDRNOTAVAIL error when listen localhost (#33) (Haoliang Gao <<sakura9515@gmail.com>>) | ||
* [[`398bc4f`](http://github.com/node-modules/detect-port/commit/398bc4f65f4d61ddfdc9bf7721118ea1a3bb6289)] - fix: handle 0.0.0.0:port binding (#26) (fengmk2 <<fengmk2@gmail.com>>) | ||
**others** | ||
* [[`aedf44f`](http://github.com/node-modules/detect-port/commit/aedf44fc3f949de9ec187bdc8ee4d8daf84d6c2b)] - doc: tweak description (xudafeng <<xudafeng@126.com>>) | ||
* [[`b7ff76f`](http://github.com/node-modules/detect-port/commit/b7ff76f24db3d8d9123cbf396b9032b05a6b7146)] - update FAQ & contributor (xudafeng <<xudafeng@126.com>>) | ||
* [[`eb279f0`](http://github.com/node-modules/detect-port/commit/eb279f0426b2876a0702a74f27657850f6ad79b2)] - Update README.md (xdf <<xudafeng@126.com>>) | ||
* [[`27bb9f0`](http://github.com/node-modules/detect-port/commit/27bb9f0eaa840fb016b4461e6bcf1a9e6b4bdcf6)] - tweak ci (xudafeng <<xudafeng@126.com>>) | ||
* [[`51e9c46`](http://github.com/node-modules/detect-port/commit/51e9c468bb4bb929ca8cf41f3f6ba1e0e0914ddd)] - tweak project (#28) (xdf <<xudafeng@126.com>>) | ||
* [[`3ba1f96`](http://github.com/node-modules/detect-port/commit/3ba1f967dd65181b8ea7f0f76f5103675548973a)] - tweak readme (xudafeng <<xudafeng@126.com>>) | ||
* [[`31562b0`](http://github.com/node-modules/detect-port/commit/31562b0b4cea215442ca8704e274930909112b8c)] - bump version to 1.2.1 (xudafeng <<xudafeng@126.com>>) | ||
* [[`4a9e127`](http://github.com/node-modules/detect-port/commit/4a9e127b6d01bd45d9b689bd931d878aa9b5d397)] - cli tweak to verbose (#25) (xdf <<xudafeng@126.com>>), | ||
1.1.3 / 2017-05-24 | ||
@@ -3,0 +23,0 @@ ================== |
@@ -59,3 +59,5 @@ 'use strict'; | ||
listen(port, 'localhost', err => { | ||
if (err) { | ||
// if localhost refer to the ip that is not unkonwn on the machine, you will see the error EADDRNOTAVAIL | ||
// https://stackoverflow.com/questions/10809740/listen-eaddrnotavail-error-in-node-js | ||
if (err && err.code !== 'EADDRNOTAVAIL') { | ||
return handleError(err); | ||
@@ -62,0 +64,0 @@ } |
{ | ||
"name": "detect-port", | ||
"version": "1.2.2", | ||
"description": "detect available port", | ||
"version": "1.2.3", | ||
"description": "Node.js implementation of port detector", | ||
"keywords": [ | ||
@@ -28,2 +28,3 @@ "detect", | ||
"eslint-config-egg": "^3.1.0", | ||
"git-contributor": "^1.0.8", | ||
"mm": "^2.1.0", | ||
@@ -35,3 +36,4 @@ "pedding": "^1.1.0" | ||
"ci": "npm run lint && egg-bin cov", | ||
"lint": "eslint ." | ||
"lint": "eslint .", | ||
"contributor": "git-contributor" | ||
}, | ||
@@ -42,3 +44,3 @@ "engines": { | ||
"ci": { | ||
"version": "4, 6, 7" | ||
"version": "4, 6, 8, 10" | ||
}, | ||
@@ -45,0 +47,0 @@ "homepage": "https://github.com/node-modules/detect-port", |
@@ -21,11 +21,11 @@ [![logo][logo-image]][logo-url] | ||
> JavaScript Implementation of Port Detector | ||
> Node.js implementation of port detector | ||
## Usage | ||
``` bash | ||
```bash | ||
$ npm i detect-port --save | ||
``` | ||
``` javascript | ||
```javascript | ||
const detect = require('detect-port'); | ||
@@ -85,3 +85,3 @@ | ||
``` bash | ||
```bash | ||
$ npm i detect-port -g | ||
@@ -92,3 +92,3 @@ ``` | ||
``` bash | ||
```bash | ||
# get an available port randomly | ||
@@ -107,4 +107,26 @@ $ detect | ||
## FAQ | ||
Most likely network error, check that your `/etc/hosts` and make sure the content below: | ||
``` | ||
127.0.0.1 localhost | ||
255.255.255.255 broadcasthost | ||
::1 localhost | ||
``` | ||
<!-- GITCONTRIBUTOR_START --> | ||
## Contributors | ||
|[<img src="https://avatars1.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars0.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars1.githubusercontent.com/u/1044425?v=4" width="100px;"/><br/><sub><b>ziczhu</b></sub>](https://github.com/ziczhu)<br/>|[<img src="https://avatars0.githubusercontent.com/u/810438?v=4" width="100px;"/><br/><sub><b>gaearon</b></sub>](https://github.com/gaearon)<br/>|[<img src="https://avatars2.githubusercontent.com/u/197375?v=4" width="100px;"/><br/><sub><b>jsw0528</b></sub>](https://github.com/jsw0528)<br/> | ||
| :---: | :---: | :---: | :---: | :---: | | ||
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto upated at `Sat Apr 21 2018 17:33:10 GMT+0800`. | ||
<!-- GITCONTRIBUTOR_END --> | ||
## License | ||
[MIT](LICENSE) |
12685
87
129
8