WinPort
- library for getting information about ports and names of processes for windows.
npm i winport
getPidByPort(port, callback)
- get process id by port.
getNameByPid(pid, callback)
- get name by process id.
var winport = require('winport'),
pid = 80;
winport.getPidByPort(80, function(error, pid) {
if (error)
console.log(error);
else
winport.getNameByPid(pid, function(error, name) {
console.log(error || name);
});
});
MIT