Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions lib/node-osx-notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,27 @@ if(!module.parent) {
});
} else {
module.exports = {
call: function(type, args, cb) {
console.info.apply(console, ['Notifying >'].concat([type], args));
/**
* Exported interface.
* @param type
* @param args
* @param [opts]
* @param [cb]
*/
call: function(type, args, opts, cb) {
// opts is optional, if argument in position 3 is a function, it was
// omitted.
if (typeof opts === 'function') {
cb = opts;
opts = {};
}

// cb is optional, but always provide a callback to execute
cb = cb || function() {};

if (opts.verbose) {
console.info.apply(console, ['Notifying >'].concat([type], args));
}

var file = binary.replace('{type}', type);
var method_args = [];
Expand Down