npm install occupied-ports
import { getPorts } from 'occupied-ports'
getPorts().then((ports) => {
console.log(ports) // [{ port: 3000, pid: 1234, process: 'node' }, ...]
})
MacOS | Windows | Linux |
---|---|---|
✅ |
Please let us know if you have tested this library on Windows or Linux, so we can update the compatibility table.
To lint the entire project, execute the following command;
npm run lint
To lint and fix the entire project, execute the following command;
npm run lint:fix
To format the entire project using prettier, execute the following command;
npm run format
To build the library, execute the following command;
npm run build
To run unit tests for the library, execute the following;
npm run test