Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

slackhooks

1.0.1 • Public • Published

slackhooks

Build Status XO code style

Send data into Slack in real-time by Incoming Webhooks.

Install

npm install --save slackhooks

Usage

const slack = require('slackhooks')
 
// id or full url
const me = 'T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
const backend = 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
 
slack('Hey today is birthday of Camila :tada:', me)
// or if is need response
slack('Hey today is birthday of Camila :tada:', me).then(res => {
  console.log(res)
})
 
// Advanced message formatting (Attachments, Message buttons)
// https://api.slack.com/docs/messages/builder
slack({
  text: 'Status: Deploy done :ok_hand: Your build exited with 0.',
  username: 'docker',
  icon_emoji: ':whale:',
  link_names: 1,
  channel: '#backend'
}, backend)

License

MIT © Jesús Lobos

Install

npm i slackhooks

DownloadsWeekly Downloads

7

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar