{"name":"portfinder","version":"1.0.36","keywords":["http","ports","utilities"],"author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"license":"MIT","_id":"portfinder@1.0.36","maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"eriktrom","email":"erik.trom.github@gmail.com"}],"homepage":"https://github.com/http-party/node-portfinder#readme","bugs":{"url":"https://github.com/http-party/node-portfinder/issues"},"dist":{"shasum":"4eef523c15e972417a9ee496c3e9c95b8f649d52","tarball":"http://registry-npm.ywwl.com/portfinder/download/portfinder-1.0.36.tgz","fileCount":5,"integrity":"sha512-gMKUzCoP+feA7t45moaSx7UniU7PgGN3hA8acAB+3Qn7/js0/lJ07fYZlxt9riE9S3myyxDCyAFzSrLlta0c9g==","signatures":[{"sig":"MEQCIDI5spXcARQA0lNK+tuN/ARKj2BmnAQFtKNGPH5SVhhvAiB2vBTiueC11vRjgwTLx1HJuezm1HjCPMzuYyAIO2O0wA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22503,"size":6753,"noattachment":false,"key":"/portfinder/-/portfinder-1.0.36.tgz"},"main":"./lib/portfinder","types":"./lib/portfinder.d.ts","engines":{"node":">= 10.12"},"gitHead":"e0081a03220003951e8981fd7e5093f712a1ddf7","scripts":{"test":"jest --runInBand"},"_npmUser":{"name":"eriktrom","email":"erik.trom.github@gmail.com"},"repository":{"url":"git+ssh://git@github.com/http-party/node-portfinder.git","type":"git"},"_npmVersion":"11.2.0","description":"A simple tool to find an open port on the current machine","directories":{},"_nodeVersion":"22.14.0","dependencies":{"async":"^3.2.6","debug":"^4.3.6"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0"},"_npmOperationalInternal":{"tmp":"tmp/portfinder_1.0.36_1744646286143_0.9887359536175","host":"s3://npm-registry-packages-npm-production"},"readme":"# node-portfinder\n\n[![CI](https://github.com/http-party/node-portfinder/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/http-party/node-portfinder/actions/workflows/ci.yml)\n\n## Installation\n\nYou can install `portfinder` using a package manager like npm, yarn, or bun:\n\n``` bash\nnpm install portfinder\n```\n\n## Usage\nThe `portfinder` module has a simple interface:\n\n``` js\nconst portfinder = require('portfinder');\n\nportfinder.getPort(function (err, port) {\n  //\n  // `port` is guaranteed to be a free port\n  // in this scope.\n  //\n});\n```\n\nOr using promises:\n\n``` js\nconst portfinder = require('portfinder');\n\nportfinder.getPortPromise()\n  .then((port) => {\n    //\n    // `port` is guaranteed to be a free port\n    // in this scope.\n    //\n  })\n  .catch((err) => {\n    //\n    // Could not get a free port, `err` contains the reason.\n    //\n  });\n```\n\n### Ports search scope\n\nBy default `portfinder` will start searching from `8000` and scan until maximum port number (`65535`) is reached.\n\nYou can change this globally by setting:\n\n```js\nportfinder.setBasePort(3000);    // default: 8000\nportfinder.setHighestPort(3333); // default: 65535\n```\n\nor by passing optional options object on each invocation:\n\n```js\nportfinder.getPort({\n  port: 3000,    // minimum port\n  stopPort: 3333 // maximum port\n}, callback);\n```\n\n## Run Tests\n``` bash\nnpm test\n```\n\n#### Author: [Charlie Robbins][0]\n#### Author/Maintainer: [Erik Trom][1]\n#### License: MIT/X11\n[0]: http://nodejitsu.com\n[1]: https://github.com/eriktrom\n","publish_time":1744646286311,"_cnpm_publish_time":1744646286311,"dist-tags":{"latest":"1.0.38"}}