Skip to content
/ psnode Public

KISS Node.js module to list and kill process on OSX and Windows

Notifications You must be signed in to change notification settings

nrako/psnode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psnode

A Node.js KISS module to list and kill process on OSX and Windows.

This use ps and tasklist to list processes and kill and taskkill to kill a process.

Install

$ npm install psnode

Usage

List processes

var ps = require('psnode');

ps.list(function(err, results) {
  if (err)
    throw new Error( err );

  console.log(results); // [{pid: 2352, command: 'command'}, {...}]
});

Kill process by PID

var ps = require('psnode');

ps.kill(12345, function(err, stdout) {
  if (err)
    throw new Error(err);

  console.log(stdout); // stdout for kill or taskkill command if any
});

Note

If the full command line is required on windows wmic.exe would be the way to go but it's not available on Windows XP Home Edition.

Licence

(MIT)

About

KISS Node.js module to list and kill process on OSX and Windows

Resources

Stars

Watchers

Forks

Packages

No packages published