pnpm
Version:
Fast, disk space efficient package manager
121 lines (120 loc) • 5.88 kB
JSON
{
"_args": [
[
{
"raw": "get-port@5.0.0",
"scope": null,
"escapedName": "get-port",
"name": "get-port",
"rawSpec": "5.0.0",
"spec": "5.0.0",
"type": "version"
},
"/home/zoltan/src/pnpm/pnpm/packages/pnpm"
]
],
"_from": "get-port@5.0.0",
"_hasShrinkwrap": false,
"_id": "get-port@5.0.0",
"_location": "/get-port",
"_nodeVersion": "8.15.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/get-port_5.0.0_1554499208865_0.8680442295680235"
},
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
"_npmVersion": "6.9.0",
"_phantomChildren": {},
"_requested": {
"raw": "get-port@5.0.0",
"scope": null,
"escapedName": "get-port",
"name": "get-port",
"rawSpec": "5.0.0",
"spec": "5.0.0",
"type": "version"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/get-port/-/get-port-5.0.0.tgz",
"_shasum": "aa22b6b86fd926dd7884de3e23332c9f70c031a6",
"_shrinkwrap": null,
"_spec": "get-port@5.0.0",
"_where": "/home/zoltan/src/pnpm/pnpm/packages/pnpm",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/get-port/issues"
},
"dependencies": {
"type-fest": "^0.3.0"
},
"description": "Get an available port",
"devDependencies": {
"@types/node": "^11.13.0",
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"directories": {},
"dist": {
"integrity": "sha512-imzMU0FjsZqNa6BqOjbbW6w5BivHIuQKopjpPqcnx0AVHJQKCxK1O+Ab3OrVXhrekqfVMjwA9ZYu062R+KcIsQ==",
"shasum": "aa22b6b86fd926dd7884de3e23332c9f70c031a6",
"tarball": "https://registry.npmjs.org/get-port/-/get-port-5.0.0.tgz",
"fileCount": 5,
"unpackedSize": 7074,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp8aJCRA9TVsSAnZWagAA+5kP/1XD9lsv5d1OAa7CA9iD\nGizMSUThhKYkm9FbAmpJmUiGZRZf7uq/39tPqONeE4ysfMiU8sx8IERlQEJY\nfwmUTo6tYZyCu/6AVtWQ997i2x+zNAC7n5uUPDEAYz+zmekHg7VYVf4Odrwz\nnBKnHtDcRsko87xQEackCwejsOdmDwxgyFXjHsp9RswZmnRNNNNMfBOSaOps\nUnZhzW8O1FF2RgEd4Mx0dedDBNIfHm7uH1T8DvZ4WYy8GlgxloEQRSCyJSUi\nb8o3/TTAUsukfaSi2zSWwLqSJUltatuX69+AyvgjSX6BnLyLQJROLLIj7zwN\nBDIc3OYR+udE3UpkzGWje10SUGiY09trLBhxCvna9vfgRiOV6iEaWpvaNhf0\nc9AdXDWFPeuWYnMEuKczuobWDZVLfmkz+ysTRbrxOjgJ4Rx8/gpS9tdmGRM7\nFSB2qRuxxpA2czJjGyUW5eZYzrBQN7oh32Et8mQDaSx7rWsyEr4jBu+jD+Tj\nRP6DEiv1OwyairD+Gv4JE5iDHo9m0tKHo4te5MFaTxAVOiXSzV2Srfu6/bN4\nnwgLNiEmRkMTdHFn1S61Z1UL6o22tZtjTELgGMGxJhDku2K8Dutl21t5fV0c\n/sOz8Dr80Svu6nUQYrVXNOdrLIB0T3R5wGikKHS9OD84ib55hc13F/4n3wL5\ndesR\r\n=IUwk\r\n-----END PGP SIGNATURE-----\r\n"
},
"engines": {
"node": ">=8"
},
"files": [
"index.js",
"index.d.ts"
],
"gitHead": "961551fa61c7eeaa35ca9bdeae84f79d0efc196b",
"homepage": "https://github.com/sindresorhus/get-port#readme",
"keywords": [
"port",
"find",
"finder",
"portfinder",
"free",
"available",
"connection",
"connect",
"open",
"net",
"tcp",
"scan",
"random",
"preferred",
"chosen"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
"name": "get-port",
"optionalDependencies": {},
"readme": "# get-port [](https://travis-ci.org/sindresorhus/get-port)\n\n> Get an available [TCP port](https://en.wikipedia.org/wiki/Port_(computer_networking))\n\n\n## Install\n\n```\n$ npm install get-port\n```\n\n\n## Usage\n\n```js\nconst getPort = require('get-port');\n\n(async () => {\n\tconsole.log(await getPort());\n\t//=> 51402\n})();\n```\n\nPass in a preferred port:\n\n```js\n(async () => {\n\tconsole.log(await getPort({port: 3000}));\n\t// Will use 3000 if available, otherwise fall back to a random port\n})();\n```\n\nPass in an array of preferred ports:\n\n```js\n(async () => {\n\tconsole.log(await getPort({port: [3000, 3001, 3002]}));\n\t// Will use any element in the preferred ports array if available, otherwise fall back to a random port\n})();\n```\n\nUse the `makeRange()` helper in case you need a port in a certain range:\n\n```js\n(async () => {\n\tconsole.log(await getPort({port: getPort.makeRange(3000, 3100)}));\n\t// Will use any port from 3000 to 3100, otherwise fall back to a random port\n})();\n```\n\n## API\n\n### getPort([options])\n\nReturns a `Promise` for a port number.\n\n#### options\n\nType: `Object`\n\n##### port\n\nType: `number | Iterable<number>`\n\nA preferred port or an iterable of preferred ports to use.\n\n##### host\n\nType: `string`\n\nThe host on which port resolution should be performed. Can be either an IPv4 or IPv6 address.\n\n### getPort.makeRange(from, to)\n\nMake a range of ports `from`...`to`.\n\nReturns an `Iterable` for ports in the given range.\n\n#### from\n\nType: `number`\n\nFirst port of the range. Must be in the range `1024`...`65535`.\n\n#### to\n\nType: `number`\n\nLast port of the range. Must be in the range `1024`...`65535` and must be greater than `from`.\n\n\n## Beware\n\nThere is a very tiny chance of a race condition if another service starts using the same port number as you in between the time you get the port number and you actually start using it.\n\n\n## Related\n\n- [get-port-cli](https://github.com/sindresorhus/get-port-cli) - CLI for this module\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
"readmeFilename": "readme.md",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/get-port.git"
},
"scripts": {
"test": "xo && ava && tsd"
},
"version": "5.0.0"
}