{"id":13583631,"url":"https://github.com/tiaanduplessis/kill-port","last_synced_at":"2025-10-19T22:29:44.697Z","repository":{"id":37617457,"uuid":"87626467","full_name":"tiaanduplessis/kill-port","owner":"tiaanduplessis","description":"❌ Kill the process running on given port","archived":false,"fork":false,"pushed_at":"2024-06-14T12:22:22.000Z","size":610,"stargazers_count":529,"open_issues_count":25,"forks_count":42,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T21:35:49.040Z","etag":null,"topics":["kill","port","process"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiaanduplessis.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}},"created_at":"2017-04-08T10:38:08.000Z","updated_at":"2025-03-31T13:23:16.000Z","dependencies_parsed_at":"2024-05-29T16:12:28.907Z","dependency_job_id":"53cd5d28-eb48-4523-8d85-4b131b832629","html_url":"https://github.com/tiaanduplessis/kill-port","commit_stats":{"total_commits":99,"total_committers":12,"mean_commits":8.25,"dds":0.6262626262626263,"last_synced_commit":"13bd91dcbf99106895325bb9f8b9b305f19b2775"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tiaanduplessis/kill-port","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fkill-port","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fkill-port/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fkill-port/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fkill-port/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/kill-port/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fkill-port/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269352261,"owners_count":24402672,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["kill","port","process"],"created_at":"2024-08-01T15:03:39.591Z","updated_at":"2025-10-19T22:29:39.645Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","HarmonyOS","others","Tools","Node.js"],"sub_categories":["Windows Manager","Terminal"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./logo.png\" alt=\"Logo\" width=\"500px\"\u003e\n\u003c/div\u003e\n\u003ch1 align=\"center\"\u003ekill-port\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eKill process running on given port\u003c/strong\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/kill-port\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/kill-port.svg?style=flat-square\" alt=\"Package version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/kill-port\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/kill-port.svg?style=flat-square\" alt=\"Downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/feross/standard\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\" alt=\"Standard\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/tiaanduplessis/kill-port\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/tiaanduplessis/kill-port.svg?style=flat-square\" alt=\"Travis Build\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/tiaanduplessis/kill-port/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/kill-port.svg?style=flat-square\" alt=\"License\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://makeapullrequest.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\" alt=\"PRs\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\n## Table of Contents\n- [Table of Contents](#table-of-contents)\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [CLI](#cli)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\n\nWith `npm`:\n```sh\nnpm install --save kill-port\n```\n\nWith `yarn`:\n```sh\nyarn add kill-port\n```\n\nWith `pnpm`:\n```sh\npnpm add kill-port\n```\n\n## Usage\n\n```js\n\nconst kill = require('kill-port')\nconst http = require('http')\nconst port = 8080\n\nconst server = http.createServer((req, res) =\u003e {\n  res.writeHead(200, {\n    'Content-Type': 'text/plain'\n  })\n\n  res.end('Hi!')\n})\n\nserver.listen(port, () =\u003e {\n  setTimeout(() =\u003e {\n    \n    // Currently you can kill ports running on TCP or UDP protocols\n    kill(port, 'tcp')\n      .then(console.log)\n      .catch(console.log)\n  }, 1000)\n})\n\n```\n\n## API\n\nThe module exports a single function that takes a port number as argument. It returns a promise.\n\n## CLI\n\nYou can use `kill-port` as a global package.\n\nInstall the package globally:\n\n```sh\n$ npm install --global kill-port\n# OR\n$ yarn global add kill-port\n```\n\nThen:\n\n```sh\n$ kill-port --port 8080\n# OR\n$ kill-port 9000\n# OR you can use UDP\n$ kill-port 9000 --method udp\n```\n\nYou can also kill multiple ports:\n\n```sh\n$ kill-port --port 8080,5000,3000\n# OR\n$ kill-port 9000 3000 5000\n```\n\nYou can also use [npx](https://nodejs.dev/learn/the-npx-nodejs-package-runner) to `kill-port` without installing:\n\n```sh\n# Kill a single port\n$ npx kill-port --port 8080\n$ npx kill-port 8080\n# Use UDP\n$ npx kill-port 9000 --method udp\n# Kill multiple ports\n$ npx kill-port --port 8080,5000,3000\n$ npx kill-port 9000 3000 5000\n```\n\n## Contributing\n\nGot an idea for a new feature? Found a bug? Contributions are welcome! Please [open up an issue](https://github.com/tiaanduplessis/feature-flip/issues) or [make a pull request](https://makeapullrequest.com/).\n\n## License\n\n[MIT © Tiaan du Plessis](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fkill-port","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Fkill-port","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fkill-port/lists"}