This package helps get the port associated with a process.
Install globally using npm:
npm install find-port-by-pid
Example Output:
import findPortByPid from "find-port-by-pid";
const port = await findPortByPid(pid: number);
console.log(port); // ["3000"]
Pull requests and improvements are welcome.
MIT License © 2025