How to use node-notifier

Comprehensive node-notifier code examples:

How to use node-notifier.on:

27
28
29
30
31
32
33
34
35
36
        title: 'OBS Replay',
        message: 'Replay buffer saved to ' + game,
        sound: true,
        wait: false,
    });
    notifier.on('click', function (notifierObject, options, event) {
        console.log(dir_path.split('/')[dir_path.split('/').length - 1])
        exec('start "" "' + dir_path.split(dir_path.split('/')[dir_path.split('/').length - 1])[0] + '"')
    });
}

How to use node-notifier.notify:

43
44
45
46
47
48
49
50
51
52
      ? path.join(require.resolve('gulp-notify'), '..', 'assets', 'gulp-error.png')
      : path.join(require.resolve('gulp-notify'), '..', 'assets', 'gulp.png'),
    title: title,
    message: message.slice(0, 100),
  });
  notifier.notify(options);
  if (isError) {
    $.util.log($.util.colors.red(message.slice(0, 1000)));
  }
}