Closed nicola closed 10 years ago
I am only using a subset of psutil, so why not using commands straight away :)
module.exports = { overthrow: function(port, done) { var command, rpid; if(process.platform === 'darwin'){ // mac os command = 'lsof -i tcp:' + port + ' | grep node | grep -i listen'; rpid = / \d+ /gm; }else{ command = 'netstat -n -a -o | grep -i listening | grep :' + port; rpid = /\d+$/gm; } execute(command, rpid, done); } };
I am only using a subset of psutil, so why not using commands straight away :)