1.5.1 • Published 2 years ago

detect-port v1.5.1

Weekly downloads
2,540,762
License
MIT
Repository
github
Last release
2 years ago

logo


NPM version build status Test coverage npm download

Node.js implementation of port detector

Who are using or has used

For more

Usage

$ npm i detect-port --save
const detect = require('detect-port');
/**
 * use as a promise
 */

detect(port)
  .then(_port => {
    if (port == _port) {
      console.log(`port: ${port} was not occupied`);
    } else {
      console.log(`port: ${port} was occupied, try port: ${_port}`);
    }
  })
  .catch(err => {
    console.log(err);
  });

Command Line Tool

$ npm i detect-port -g

Quick Start

# get an available port randomly
$ detect

# detect pointed port
$ detect 80

# output verbose log
$ detect --verbose

# more help
$ detect --help

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

Contributors

xudafengfengmk2ziczhugaearonchnliquanpopomore
snapreyavuzakyuzantife-yinyue

This project follows the git-contributor spec, auto updated at Wed Sep 21 2022 23:10:27 GMT+0800.

License

MIT

@tuzki/scaffold-build-cli@microsoft/teamsfx-core@tonyyanga/mintlify_cli@itwin/certablitz@docusaurus/core@christensena/react-scriptsxuirecorderplustesting-inspectoroxygenide@asiachan/debugtstlighting-plugin-debug-modulebase-supporttest-inspectorapt-mobileapp-inspectortesting-app-inspector@omake/react-scriptsapt-mobile-inspectorcustom-react-scripts-with-modulesopinionated-react-scripts@chrissong/react-setupecarx-build@citcfe/cicli-scriptsget-clean-portdh-scripts-webreact-scripts-starterkit@gomoko/create@rari-capital/solidity-coveragebpuns-testsparrow-bird-server@ez-fe/build@ez-fe/devumo-bakery@cvpcasada/nwbegg-bin-cut@kununu/react-universal-scriptsopr-webpackreact-scripts-in-public@dh-js/scripts-reactlpp-databaseisv-lynx-devreact-scripts-by-featurereact-scripts-css-varsreact-scripts-cssm-hmrreact-scripts-pluggablereact-scripts-thtliife-modreact-storybook-scriptstdp-datamodeler@inventorjs/plugin-app-react-webpack@saaspe/components@bytebean/create@uponcommerce/createsciolareact-scripts-electron-targetkudos-climock-servicesspice-traders-cligatsby@everything-registry/sub-chunk-1471cherry-scriptsaf-webpack-extra@daiyam/docz-core@dcloudio/uni-debugger@ddot/plugin-utilsdc-react-scripts@devex-web-frontend/react-scripts-dx@dishuostec/snowpackdev-server-ports@dozoisch/react-scripts@dotted/react-scripts-outpostesportdf-react-scripts@digitalrakesh/jsui@dcheng168/react-scripts@dcloudio/uni-vue-devtools@dimcheify/dimuidesign-system-fitbank-450@digiforce-cloud/build-scripts@dhis2/cli-app-scripts@dh-scripts/react@drinkjs/mojito-compiler@driveback/react-scripts-ddmdigiforce-build-scripts@datapipeline/react-scriptsdatahub-middlewareexpress-router-clif_yoshifable-react-scriptsfetpfengdiefeeble-scriptsextendable-react-scriptsfie-toolkit-retailfidbfirebasenodefinzipper-react-scriptsfishx-gui-serverfn-lib-exampleflipper-testforkcustom-react-scriptsfuse-box-react-scripts
1.5.1

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.5.1-beta

2 years ago

1.3.0

5 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago