Find processes occupying a given port
lsofi
Rationale
lsof -i :<port>
for unix, darwin and win32 alike
Installation
Grab it from npm
npm install --save lsofi
Usage
// given 1337 is occupied and 1338 is notconst lsofi = const occupied = await const free = await1338 console// => console.log(9834, null)
See also
- krampus - Kill processes occupying a given port
lsofi is built by marionebl and contributors. It is released unter the MIT license.