Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

good-slack

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

good-slack

Slack Webhook message posting for Good process monitor

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
1
Created
Source

good-slack

Slack Webhook message posting for Good process monitor

Build Status Current Version

Usage

good-slack is a good reporter implementation to send hapi server events to Slack using Incoming Webhooks.

new GoodSlack(config)

Creates a new GoodSlack object with the following arguments:

  • config - config object
    • url - a string with the Webhook URL
    • [slack] - an object of slack overridable parameters (See Incoming Webhooks)
    • [format] - MomentJS format string. Defaults to 'YYMMDD/HHmmss.SSS'.
    • [host] - a string with the server hostname. - Defaults to actual hostname.
    • [basicLogEvent] - a boolean to set the style of log events. When set to true, log events will be sent as text instead of attachments. Defaults to false.

Using with Hapi

Below is an example, based on the hapi plugin documentation examples, of using good-slack and good-squeeze together in a Hapi server to log all internal error messages to a slack channel.

const Hapi = require('@hapi/hapi');
const start = async function () {

  const server = Hapi.server();

  await server.register({
    plugin: require('@hapi/good'),
    options: {
      reporters: {
        slack: [{
          module: '@hapi/good-squeeze',
          name: 'Squeeze',
          args: [{ error: '*' }]
        }, {
          module: 'good-slack',
          args: [{ url: 'https://hook.slack.com/services/UNIQUE_SLACK_CHANNEL_URL' }]
        }]
      }
    }
  })
};

Compatibility

  • This version (v4) is compatible with @hapi/good@8.x.x, in which hapi moved to scoped package names.
  • Use v3 for good@7.x.x, which introduced major changes on reporter interface.
  • Use v2 for legacy support of good@6.x.x.

Keywords

hapi

FAQs

Package last updated on 10 May 2019

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