diff options
Diffstat (limited to 'node_modules/get-port')
-rw-r--r-- | node_modules/get-port/index.js | 28 | ||||
-rw-r--r-- | node_modules/get-port/license | 9 | ||||
-rw-r--r-- | node_modules/get-port/package.json | 44 | ||||
-rw-r--r-- | node_modules/get-port/readme.md | 64 |
4 files changed, 0 insertions, 145 deletions
diff --git a/node_modules/get-port/index.js b/node_modules/get-port/index.js deleted file mode 100644 index fbd74e6e6..000000000 --- a/node_modules/get-port/index.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -const net = require('net'); - -const getPort = options => new Promise((resolve, reject) => { - // For backwards compatibility with number-only input - // TODO: Remove this in the next major version - if (typeof options === 'number') { - options = { - port: options - }; - } - - const server = net.createServer(); - - server.unref(); - server.on('error', reject); - - server.listen(options, () => { - const port = server.address().port; - server.close(() => { - resolve(port); - }); - }); -}); - -module.exports = options => options ? - getPort(options).catch(() => getPort(0)) : - getPort(0); diff --git a/node_modules/get-port/license b/node_modules/get-port/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/get-port/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/get-port/package.json b/node_modules/get-port/package.json deleted file mode 100644 index 3fe192258..000000000 --- a/node_modules/get-port/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "get-port", - "version": "3.2.0", - "description": "Get an available port", - "license": "MIT", - "repository": "sindresorhus/get-port", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "port", - "find", - "finder", - "portfinder", - "free", - "available", - "connection", - "connect", - "open", - "net", - "tcp", - "scan", - "rand", - "random", - "preferred", - "chosen" - ], - "devDependencies": { - "ava": "*", - "pify": "^3.0.0", - "xo": "*" - } -} diff --git a/node_modules/get-port/readme.md b/node_modules/get-port/readme.md deleted file mode 100644 index 72c1fbc01..000000000 --- a/node_modules/get-port/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# get-port [](https://travis-ci.org/sindresorhus/get-port) - -> Get an available port - - -## Install - -``` -$ npm install get-port -``` - - -## Usage - -```js -const getPort = require('get-port'); - -getPort().then(port => { - console.log(port); - //=> 51402 -}); -``` - -Optionally, pass in a preferred port: - -```js -getPort({port: 3000}).then(port => { - console.log(port); - // Will use 3000 if available, otherwise fall back to a random port -}); -``` - - -## API - -### getPort([options]) - -Returns a `Promise` for a port number. - -#### options - -Type: `Object` - -##### port - -Type: `number` - -The preferred port to use. - -##### host - -Type: `string` - -The host on which port resolution should be performed. Can be either an IPv4 or IPv6 address. - - -## Related - -- [get-port-cli](https://github.com/sindresorhus/get-port-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) |