Flash an OS notification when a process writes to
npm install stderr --save
npm install stderr -g
stderr exports one, single function. Require it and pass in a command, an array of arguments, and (optional) options.
var stderr = require('stderr') stderr('ls', ['-la'])
This is the same API (and options) as
child_process.spawn. All options other than
stdio will be passed through.
The cli is made to be as simple as possible. Simply prefix your command with
stderr like so:
stderr ls -la
stderr will display a notification when a process:
- Writes to stderr
- Throws an error
All standard streams are left untouched by stderr. Standard input, output, and error streams should be exactly as they are with the non-prefixed version of the command. That means all piping, redirection, and bash craziness you'd like to get get into should just work.
If you are on a system without notifications (like a server environment) they will simply fail silently, and your program will continue to read and write as usual, there just won't be any notifications.
stderr uses the excellent node-notifier module so be sure to read up on what platforms are supported.
With stderr, Tom just prepends the word
stderr to his
watchify command and now his computer magically notifies him that he stupidly missed a closing bracket. This saves him time and needless refreshing.
CONTRIBUTING.md for contribution guidelines.