0.0.4 • Published 9 years ago

pstracker v0.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

PSTracker

A Node.js module for tracking process spawning and killing.

PSTracker emits spawned and killed events for a particular process tracked by either pid or command (as provided by ps-node).

Install

$ npm install pstracker

Usage

Create a tracker for a particular process with a specified pid:

var psn = require('pstracker');

var t = psn({ pid: 12345 });

// registers listeners for 'spawned' and 'killed' events
t.on('spawned', function (proc) {
  console.log('spawned:', proc);
});
t.on('killed', function (proc) {
  console.log('killed:', proc);
});

Or use a RegExp to filter command and arguments to track a process(es):

var psn = require('pstracker');

var t = psn({
  command: 'node',
  arguments: '--debug'
});

// register listeners for 'spawned and 'killed' events
...

Note: When multiple process match a filter, individual spawned and killed events will be fired per process match.

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago