bebraw
6/22/2013 - 2:17 PM

Pipe to OS X notifier. Requires https://npmjs.org/package/node-notifier and https://github.com/alloy/terminal-notifier . You can install

Pipe to OS X notifier.

Requires https://npmjs.org/package/node-notifier and https://github.com/alloy/terminal-notifier . You can install latter through MacPorts (port install terminal-notifier).

Usage: foo | ./notify.js

#!/usr/bin/env node
var notifier = require('node-notifier');
var stdin = process.openStdin();


stdin.setEncoding('utf8');
stdin.on('data', function(chunk) {
    notifier.notify({message: chunk});
});