npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mozaik-ext-slack

v0.9.0

Published

Slack widgets to Mozaik dashboard

Downloads

11

Readme

mozaik-ext-slack

Module provides some Slack widgets for Mozaïk dashboard.

preview-channel

Setup

Follow the steps to install and configure widget into dashboard

Dependencies

  • Install module in dashboard directory:

    npm install -S mozaik-ext-slack
  • Register client api by adding to dashboard src/server.js:

    // NOTE: Widget uses push method to delivery messages!
    import slack from 'mozaik-ext-slack/client';
    mozaik.bus.registerApi('slack', slack, 'push');
  • Register widgets by adding to dashboard src/App.jsx:

    import slack from 'mozaik-ext-slack';
    mozaik.addBatch('slack', slack);
  • Build the dashboard:

    npm run build-assets

Slack

  • Generate/collect the Slack token: https://api.slack.com/docs/oauth-test-tokens
  • Place token in dashboard .env file:
SLACK_TOKEN=value-provided-by-slack

Widgets

Set api and widget configuration values in dashboard config.js. See followup sections for details.

module.exports = {
  // Configure api
  api: {
    slack: {
      // Slack api token
      // $SLACK_TOKEN
      token: 'valuefromslack',

      // NOTE: Following config parameters are OPTIONAL!
      // Download the uploaded images and show them in dashboard
      // $SLACK_SHOW_IMAGES
      showImages: true,
      // Directory where the static files are hosted from. Needed for images. Defaults to cwd() + './build'
      publicDir: '/path/to/mozai-demo/build',
      // The age of temp images to delete
      // $SLACK_MAX_IMAGE_AGE
      maxImageAge: '8 hours',
  },

  // Set widgets
  dashboards: [
    columns: 2,
    rows: 2,
    // See next sections for details
    widgets: [
      {
        type: 'slack.channel',
        channel: 'general',
        showPulse: true,
        columns: 1, rows: 1,
        x: 0, y: 0
      },
      {
        type: 'slack.pulse',
        columns: 1, rows: 1,
        x: 1, y: 0
      },
    ]
  ]
}

Finally, start the dashboard with command:

node app.js

Widget: slack.channel

Show pulsating circle for each message sent in Slack channel(s)

preview-channel

preview-channel

parameters

key | required | description --------------|----------|--------------- title | no | Textual title to show. Example: '#mychannel'. channel | no | Channels to follow, separated with comma. Defaults to all the channels the token has permission to. Supports including/excluding rules by micromatch. Leading hash character ignored imageSize | no | Scaling of image: initial, cover, contain. Default to initial showImages | no | Show images or not. Defaults to true showPulse | no | Show pulse visualisation on each message or not. Defaults to false keyword | no | Show only message containing the defined keyword. Supports regexp like ^foo. For file upload, the match is done against initial comment or title config | no | Override default pulse config parameters or colors. See source code for details

usage

{
  type: 'slack.pulse',
  channel: 'general,!sales',
  columns: 2, rows: 1,
  x: 1, y: 0
}

Widget: slack.pulse

Show pulsating circle from each message sent in Slack channel(s)

preview-pulse

parameters

key | required | description --------------|----------|--------------- channel | no | Channels to follow, separated with comma. Defaults to all the channels the token has permission to. Supports including/excluding rules by micromatch. Leading hash character ignored title | no | Textual title to show. Example: '#mychannel'.

usage

{
  type: 'slack.pulse',
  channel: '*',
  columns: 2, rows: 1,
  x: 1, y: 0
}

License

Distributed under the MIT license

Changelog

Release 0.9.0

  • Added support for including/excluding channel messages by using advanced globbing channel name rules like: general, !sales, team-* (general -channel and all the channels starging with "team-". Explicitly no sales)
  • Improved internal identifier

Release 0.8.0

  • Added support for restoring latest message from browser storage

Release 0.7.2

  • Updated documentation

Release 0.7.1

  • Show pulse only on new API data

Release 0.7.0

  • Add support for keywords: Show only messages matching with the rule

Release 0.6.0

  • Add support to show pulse within channel widget

Release 0.5.0

  • Adjust font size automatically: Based on given size and length of text
  • Improved ripple to have random location and more configurable outcome
  • Fixed #7: Show bot messages
  • Created echoMessage for testing purpsoses

Release 0.4.0

  • Added support for pulse configuration
  • Multiple ripples per message

Release 0.3.1

  • Improved error cases and logging

Release 0.3.0

  • Added support for showing images
  • Added support for showing emojis
  • Added duration info since previous message
  • Improved message formatting

Release 0.2.0

  • Added since time information
  • Fixed issue when having multiple pulse widgets
  • Improved style

Release 0.1.0

  • Initial somewhat working version