slack-webhook-notify
v1.0.1
Published
sending message via slack webhook
Downloads
5
Readme
Slack Notify
sending message via slack webhook
install
npm install --save slack-webhook-notify
Usage
- import
const {slackNotify, SlackNotifierConstructor} = require('slack-webhook-notify')
- use constructor
const sender = SlackNotifierConstructor('your url')
try{
const responseBody = await sender.send('hello slack')
} catch(e) {
console.error(e)
}
- use method
try{
const responseBody = await slackNotify('your url', 'hello slack')
} catch(e) {
console.error(e)
}
- configureation(disable logger)
const sender = SlackNotifierConstructor('your url', {log: false})
// or
await slackNotify('your url', 'hello slack', {log: false})