{"id":13403127,"url":"https://github.com/http-party/node-portfinder","last_synced_at":"2025-05-12T13:26:24.466Z","repository":{"id":38326216,"uuid":"2018652","full_name":"http-party/node-portfinder","owner":"http-party","description":"A simple tool to find an open port or domain socket on the current machine","archived":false,"fork":false,"pushed_at":"2025-04-28T19:02:01.000Z","size":458,"stargazers_count":889,"open_issues_count":4,"forks_count":98,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-08T03:36:18.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/http-party/node-portfinder","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/http-party.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-07-08T16:15:01.000Z","updated_at":"2025-04-28T19:02:04.000Z","dependencies_parsed_at":"2024-06-18T11:09:31.517Z","dependency_job_id":"ea461984-586b-4b9a-9daf-fee2f1e09f9d","html_url":"https://github.com/http-party/node-portfinder","commit_stats":{"total_commits":165,"total_committers":37,"mean_commits":4.45945945945946,"dds":0.7272727272727273,"last_synced_commit":"123a06f8028288a0f196cef4bf1346f818a8cd73"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-party%2Fnode-portfinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-party%2Fnode-portfinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-party%2Fnode-portfinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-party%2Fnode-portfinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/http-party","download_url":"https://codeload.github.com/http-party/node-portfinder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253273342,"owners_count":21881967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:01:25.773Z","updated_at":"2025-05-12T13:26:24.430Z","avatar_url":"https://github.com/http-party.png","language":"JavaScript","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) =\u003e {\n    //\n    // `port` is guaranteed to be a free port\n    // in this scope.\n    //\n  })\n  .catch((err) =\u003e {\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","funding_links":[],"categories":["JavaScript","Repository","Uncategorized","others"],"sub_categories":["Network","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttp-party%2Fnode-portfinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhttp-party%2Fnode-portfinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttp-party%2Fnode-portfinder/lists"}