osx-notifier
Reduction of node-osx-notifier to drive from the command line or directly from another node.js script, instead of an express server.
Command line install & usage
npm install -g osx-notifier
Usage (osx-notifier --help
):
osx-notifier --type type of icon to show; one of "info", "fail", or "pass" [default: "info"] --title title of the notification [default: "Terminal"] --subtitle subtitle of the notification --message message body of the notification [required] --group replace and be replaced by any notifications of the same group --remove remove any notifications previously posted with this group --list list notifications previously posted with this group --activate bundle identifier of an application to be activated
API install & usage
npm install osx-notifier
Or in your package.json:
Usage:
var notify = ; var duration = 45;;
--type
The Mac OS X Notification Center can only be accessed via signed apps, and any message sent from an application must be accompanied by the icon for that application.
Three variations on terminal-notifier are included with this app,
which are accessed via the different --type
options:
--type |
sample |
---|---|
info |
|
pass |
|
fail |
Winston integration
You can use this functionality from within winston (a popular logging library) as a "Transport" via my winston-notification-center
plugin package (available from npm).
Example:
var winston = ;var NotificationCenterTransport = ;winston;winston;
See the winston-notification-center project page for more options.
Credits
Thanks to azoff for the prebuilt apps and the screenshots, and to alloy for the great OS X application wrapper.
License
Copyright 2013 Christopher Brown. MIT Licensed.