Skip to content

Dead simple process manager with few features (features cli & programmatic use)

License

Notifications You must be signed in to change notification settings

serapath/lilpids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lilpids

Dead simple process manager with few features (features cli & programmatic use)

inspiration comes from the lil-pids module from @mafintosh

omg

usage

npm install -g lilpids

It can either be used as a cli-tool (see lil-pids)

Otherwise, it also can be used programmatically.

var lilpids = require('lilpids')

var stream$ = lilpids()

stream$.on('error', function (error) {
  throw error
})

stream$.on('data', function (pids) {
  console.log(pids) // e.g.
  /*
  [ { pid: '15679', service: 'node test/a.js' },
    { pid: '15685', service: 'node test/b.js' } ]
  */
})

stream$.write([
  'node test/a.js',
  'node test/b.js'
])

setTimeout(function () {
  stream$.write([ 'node test/a.js' ])
}, 15000)

It'll watch the stream so every time you pipe an update, old processes no longer referenced in the update will be shutdown and any new ones will be spawned.

lilpids will forward all stdout, stderr to its own stdout, stderr prefixed with the process id.

It will also tell you when a command has been spawned, exited and finally it will restart processes when they crash/end.

lilpids will also push an array of the pids of the current running processes to the stream every time there is a change, so you can listen for them

license

MIT

About

Dead simple process manager with few features (features cli & programmatic use)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published