Package Exports
- crossplatform-killport
- crossplatform-killport/killport.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (crossplatform-killport) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
crossplatform-killport
Command line program to kill the process running on a given port in any operating system.
Unlike many of the other programs out there that do this, this one works in Windows, Linux, and Mac, it is very easily installed in any OS using npm because it is written in Node.js, and it is actively maintained by a team of people rather than being just some guy's project from several years ago that may or may not work.
Usage
First make sure Node.js is installed on your system.
Then, to install crossplatform-killport to your system:
npm i -g crossplatform-killportKill whatever process is using port 8080:
killport 8080Use via npx (this will allow you to use it without installing it to your system by downloading it from npm temporarily):
npx crossplatform-killport 8080Use from within a Node.js project's root directory:
node node_modules/.bin/crossplatform-killport/killport.js 8080Use from within Node.js code:
const { spawnSync, } = require('child_process')
spawnSync('node', ['node_modules/.bin/crossplatform-killport/killport.js', '8080', '--silent'], { env: process.env, shell: false, stdio: ['ignore', 'pipe', 'pipe'] })