Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

freeman-slack

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

freeman-slack

publish a message to multiple Slack channels/accounts simultaneously

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

freeman-slack 🐸

Publish messages to multiple Slack accounts & channels simultaneously.

use case

This is a wrapper for slack-notify (NPM module) with the added advantage of publishing to multiple accounts.

We use this so we can receive info and bug messages in the Freeman Industries Slack, and simultaneously publish the same messages to a channel our clients' Slack channels.

Someone who needs to publish a message to more than one Slack account will find this useful.

initializing

var product_name = "A Freeman Industries node.js app";

var accounts = [{
    name: "Freeman Industries",
    channel: "#dedicated-app-channel",
    info_emoji: ":muscle:",
    bug_emoji: ":scream:",
    hook: "https://hooks.slack.com/services/..."
}, {
    name: "Client",
    channel: "#app-freeman-industries-made-for-us",
    info_emoji: ":ocean:",
    bug_emoji: ":volcano:",
    hook: "https://hooks.slack.com/services/..."
}]

var slack = require('freeman-slack')(product_name, accounts);

available commands

slack.info

Here's how we usually use it. text and fields are both required, even if empty string/object. You can have as many fields as you like. In this example product_name is a global, and message is a JS object that's been passed to a function.

slack.info({
  text: 'Info message on ' + product_name + '!',
  fields: {
      'Body': id,
      'More info': JSON.stringify(message)
  }
});

slack.bug

Pretty much the same as above. Customize to your heart's content!!

slack.bug({
  text: 'New bug on ' + product_name + '!',
  fields: {
      'Function': id,
      'Error body': JSON.stringify(message)
  }
});

contributions

All contributions are welcome 🌞

Keywords

FAQs

Package last updated on 14 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc