{"id":22281890,"url":"https://github.com/rrainn/portprocesses","last_synced_at":"2025-03-25T19:23:51.352Z","repository":{"id":57327599,"uuid":"147974555","full_name":"rrainn/PortProcesses","owner":"rrainn","description":"📦 NPM Package - List and Kill processes on a specified port","archived":false,"fork":false,"pushed_at":"2021-03-31T03:46:12.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T06:44:28.653Z","etag":null,"topics":[],"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/rrainn.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}},"created_at":"2018-09-08T22:31:08.000Z","updated_at":"2021-03-31T03:46:11.000Z","dependencies_parsed_at":"2022-09-16T07:11:41.326Z","dependency_job_id":null,"html_url":"https://github.com/rrainn/PortProcesses","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrainn%2FPortProcesses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrainn%2FPortProcesses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrainn%2FPortProcesses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rrainn%2FPortProcesses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rrainn","download_url":"https://codeload.github.com/rrainn/PortProcesses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245527547,"owners_count":20630044,"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-12-03T16:23:05.408Z","updated_at":"2025-03-25T19:23:46.342Z","avatar_url":"https://github.com/rrainn.png","language":"JavaScript","readme":"# PortProcesses\n\n## Install\n\n    npm install -g portprocesses\n\n## Usage\n\n### CLI\n\nThe following command will list all processes running on port `8000`. You can replace `8000` with any port to get the processes running on that port. The output will be in JSON format.\n\n    portprocesses list 8000\n\nThe following command will kill all processes running on port `8000`. You can replace `8000` with any port to kill the processes running on that port.\n\n    portprocesses kill 8000\n\n### Node.js\n\nThe following code will list all processes running on port `8000`. You can replace `8000` with any port to get the processes running on that port.\n\n```js\nconst portprocesses = require('portprocesses');\nconst promise = portprocesses.listProcessesOnPort(8000); // this returns a promise\npromise.then((result) =\u003e {\n\tconsole.log(result); // JSON array\n\t// [ { command: 'node',\n\t// pid: '123',\n\t// user: 'user',\n\t// fd: '22u',\n\t// type: 'IPv4',\n\t// device: '0x01abc3456d789012',\n\t// 'size/off': '0t0',\n\t// node: 'TCP',\n\t// name: '10.0.0.1:12345-\u003e123.456.7.89:http (CLOSE_WAIT)' } ]\n});\npromise.catch((err) =\u003e {\n\tconsole.error(err);\n});\n```\n\nThe following code will kill all processes running on port `8000`. You can replace `8000` with any port to kill the processes running on that port.\n\n```js\nconst portprocesses = require('portprocesses');\nconst promise = portprocesses.killAllProcessesOnPort(8000); // this returns a promise\npromise.then((result) =\u003e {\n\tconsole.log(result); // JSON array\n\t// [ { pid: '123'\n\t// success: true } ]\n});\npromise.catch((err) =\u003e {\n\tconsole.error(err);\n});\n```\n\nIn this case success for a given process can be false without the process throwing an error. Therefor upon success of the promise it's recommended to check the array for any items that have `success` set to `false`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrainn%2Fportprocesses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frrainn%2Fportprocesses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrainn%2Fportprocesses/lists"}