1.0.2 • Published 9 years ago

notify-slack v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

#notify-slack Log to a Slack channel. Useful for server monitoring.

#Installing npm install notify-slack

#Usage

var NotifySlack = require('notify-slack');
var ns = new NotifySlack({
  'webhookURL' : '...', //Slack webhook URL
  'defaultChannel' : '...', //Default Slack channel to post to
  'errorChannel' : '...', //(Optional) Error Slack channel to post to, for messages marked as 'error'
  'moduleName' : '...', //(Optional) Name will be prepended to Slack message, in order to identify which module it was referring to.
  'username' : '...', //(Optional) username of Slack bot when posting messages. Defaults to NSBot.
  'userIcon' : '...', //(Optional) user icon of Slack bot when posting messages. Defaults to Slack logo.
  'log' : false, //(Optional) log the message sent to Slack to the console, along with a timestamp. Defaults to false. 
});

ns.notify('All good.'); //post a message to the default channel in Slack. 
ns.notify("Everything's on fire!!!", true); //post a message to the error channel in Slack (if specified, otherwise will post to the default channel). 
1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago