How to use the node-notifier.notify function in node-notifier

To help you get started, we’ve selected a few node-notifier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jkrup / pwatch / src / main.js View on Github external
function handlePid(pid) {
  if (!pid) {
    notifier.notify('No pid specified');
    process.exit(0);
  }
  if (String(pid).match(/search/i)) {
    search(process.argv[3]);
  } else if (Number.isNaN(Number(pid))) {
    help();
  } else {
    // Run in BG
    spawn('node', [`${__dirname}/runCheckPid.js`, pid], {
      stdio: 'ignore',
      detached: true,
    }).unref();
  }
}
github RoccoC / webpack-build-notifier / index.js View on Github external
msg = warning ? this.messageFormatter(warning, warning.module && warning.module.rawRequest ? warning.module.rawRequest : '') : 'Unknown';
        icon = this.warningIcon;
        sound = this.warningSound;
        buildSuccessful = false;
    } else {
        title += 'Success';
        if (this.suppressSuccess === "always" || (this.suppressSuccess === "initial" && !hasRun)) {
            notify = false;
        } else if (this.suppressSuccess === false || !buildSuccessful) {
            notify = true; // previous build failed, let's show a notification even if success notifications are suppressed
        }
        buildSuccessful = true;
    }

    if (notify) {
        notifier.notify(
            Object.assign(this.notifyOptions, {
                appName: this.appName,
                title: title,
                message: stripAnsi(msg),
                sound: sound,
                contentImage: this.logo,
                icon: icon,
                wait: !buildSuccessful
            })
        );
        if (onComplete) {
            onComplete(results.compilation, compilationStatus);
        }
    }

    if (this.activateTerminalOnError && !buildSuccessful) {
github godaddy / godaddy-test-tools / lib / index.js View on Github external
function notify(options) {
  log(options.title + ': ' + options.message);
  if (!argv.noNotify) {
    notifier.notify(options);
  }
}
github strues / boldr / tools / utils.js View on Github external
export function log(options: NotificationOptions) {
  const title = `${options.title.toUpperCase()}`;

  if (options.notify) {
    notifier.notify({
      title,
      message: options.message,
    });
  }

  const level = options.level || 'info';
  const msg = `==> ${title} -> ${options.message}`;

  switch (level) {
    case 'warn': console.log(colors.red(msg)); break;
    case 'error': console.log(colors.bgRed.white(msg)); break;
    case 'info':
    default: console.log(colors.green(msg));
  }
}
github mzwallace / dw-cli / commands / watch.js View on Github external
    const debouncedNotify = debounce(args => notifier.notify(args), 150);
    const uploading = new Set();
github w3tecch / express-typescript-boilerplate / build / util.js View on Github external
notify: function notify(title, message) {
        notifier.notify({
            'title': title || 'Gulp',
            'message': message || 'Please check your log or open your browser.',
            icon: process.cwd() + '/icon.png'
        });
    }
};
github jdxcode / tmux-weather / src / tmux-weather.ts View on Github external
function notify(msg?: string) {
  if (!notifier || !msg) return
  notifier.notify({
    title: 'tmux-weather',
    message: msg,
  })
}
github ipfs-shipyard / ipfs-desktop / src / controls / drag-drop.js View on Github external
function notify (title, message) {
  notifier.notify({
    appName: 'ipfs.station',
    title,
    message,
    icon: iconPath,
    sound: true,
    wait: false
  })
}
github vanita5 / birdknife / src / libs / twitter-api.js View on Github external
this.stream.on('direct_message', message => {
            self.displayDM(message.direct_message);

            if (self.preferences.get('notifications')) {
                notifier.notify({
                    title: `Message from @${message.sender_screen_name}`,
                    message: message.text
                });
            }
        });