Name: detect-port
Owner: node_modules
Description: Node.js implementation of port detector
Created: 2015-05-30 02:50:53.0
Updated: 2018-05-24 09:44:00.0
Pushed: 2018-05-16 13:26:48.0
Size: 71
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Node.js implementation of port detector
m i detect-port --save
avascript
t detect = require('detect-port');
allback usage
ct(port, (err, _port) => {
(err) {
console.log(err);
(port == _port) {
console.log(`port: ${port} was not occupied`);
else {
console.log(`port: ${port} was occupied, try port: ${_port}`);
or a yield syntax instead of callback function implement
t co = require('co');
unction *() {
nst _port = yield detect(port);
(port == _port) {
console.log(`port: ${port} was not occupied`);
else {
console.log(`port: ${port} was occupied, try port: ${_port}`);
se as a promise
ct(port)
hen(_port => {
if (port == _port) {
console.log(`port: ${port} was not occupied`);
} else {
console.log(`port: ${port} was occupied, try port: ${_port}`);
}
atch(err => {
console.log(err);
;
m i detect-port -g
t an available port randomly
tect
tect pointed port
tect 80
tput verbose log
tect --verbose
re help
tect --help
Most likely network error, check that your /etc/hosts
and make sure the content below:
0.0.1 localhost
255.255.255 broadcasthost
localhost
|
xudafeng
|
fengmk2
|
ziczhu
|
gaearon
|
jsw0528
| :—: | :—: | :—: | :—: | :—: |
This project follows the git-contributor spec, auto upated at Sat Apr 21 2018 17:33:10 GMT+0800
.