0.3.1 • Published 9 years ago

process-watch v0.3.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

About

A simple fluent API for watching and managing OS processes.

Usage

var pw = require('process-watch');

// optional parentPid to ensure process uniqueness
var process = pw.watch('node app.js', parentPid)
  .error(function(err) {
    // an error occurred
  })
  .started(function() {
    // process started
  })
  .killed(function() {
    // process was killed
  })
  .restarted(function() {
    // process has been restarted
  })
  .start(100);  // watch every 100 milliseconds (default)

process.kill();
process.unwatch();

Note that the process being watched may not exist at the time the watcher is initialized.

License

MIT

Copyright (c) 2015 Samuel Fortier-Galarneau samuel.galarneau@gmail.com