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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hubot-bangbang

v0.1.3

Published

Execute changeable pre-defined shell commands via hubot in a secure way !!

Readme

hubot-bangbang

Build Status

NPM

Execute changeable pre-defined shell commands via hubot in a secure way !!

See src/bangbang.coffee for full documentation.

Installation

In hubot project repo, run:

npm install hubot-bangbang --save

Then add hubot-bangbang to your external-scripts.json:

[
  "hubot-bangbang"
]

Configuration

hubot-bangbang uses hubot-auth and is configured via the following environment variables:

  • HUBOT_BANGBANG_COMMANDS_FILE -- File to load executable commands from; see below for file format.
  • HUBOT_BANGBANG_TIMEOUT -- Timeout for shell executions of commands; default is 10000.
  • HUBOT_BANGBANG_LOG_LEVEL -- Log level, default is info.
  • HUBOT_BANGBANG_ROLE -- If set, auth role required to interact with Bosun. Default is bangbang.
  • HUBOT_BANGBANG_SLACK -- If yes enables rich text formatting for Slack, default is no.

Commands File Format

hubot-bangbang executes pre-defined shell commands. These commands are defined by a commands file which is passed via the environment variable HUBOT_BANGBANG_COMMANDS_FILE to hubot-bangbang. The file must contain a JSON object array of zero or more objects. The file may be modified and reloaded during the runtime of hubot. See the Commands section for details.

For each object, the following keys are used:

  • name -- name of the command (mandatory)
  • description -- description of the command; used in some Hubot replies (mandatory)
  • regex -- the regular expression used by Hubot to recognize the command; may contain capture groups useful for parameters (mandatory)
  • exec -- the shell command to execute; may use $n with n in [1..] to address capture groups; (mandatory)
  • output_type -- the format to set the output in; valid alternatives are markdown, pre, plain, ignore (mandatory)
  • timeout -- timeout for shell execution; defaults to environment variable HUBOT_BANGBANG_TIMEOUT (optional)
  • role -- if set, a user must have this role in addition to
  • HUBOT_BANGBANG_ROLE; allows the admin to protect some commands with additional access control (optional)

Output Formats

The output may be formatted in different styles. This is especially useful when hubot-bangbang is used with Slack. The following format alternatives may be used:

  • markdown -- The output is already Markdown formatted and will be passed as Markdown to Slack.
  • pre -- The output format is plain text, but will formatted as pre-formatted code block. This means, the output will be surrounded by ``` and passed as Markdown to Slack.
  • plain -- The output is passed unmodified as plain text.
  • ignore -- The output is ignored.

Example

In the example below, there are two commands. The first command, date, specifies the mandatory keys only. The second command, use report, retrieves a USE report from a remote server. Since the report is formatted in Markdown, the command will pass the output as Markdown to Slack for a pretty presentation. In order to retrieve a use report, the user must posses both roles, bangbang as well as bangbang.use_report.

[
  {
    "name": "date",
    "description": "retrieve local date from the specified host",
    "regex": "get date for (.+)",
    "exec": "echo ssh $1 date",
    "output_type": "plain"
  },
  {
    "name": "use report",
    "description": "retrieve an USE report from the specified host",
    "regex": "get use report for (.+)",
    "exec": "ssh $1 usereport.py",
    "output_type": "markdown",
    "timeout": 60,
    "role": "bangbang.use_report"
  }
]

Commands

hubot-bangbang process two types of commands. General commands are used to interact with hubot-bangbang and are shown when Hubot is asked for help. Shell commands are load from the commands file. In order to run a shell command, first you have type the prefix !! followed by a space and then the a command that is recognized by one of the regular expressions defined for the shell commands.

General Commands

  • show bangbang commands -- Shows currently available shell commands.
  • reload bangbang commands -- Reloads shell commands definition from commands file.

Shell Commands

You can run the above commands like this:

@hubot !! get date for www.test.com

and

@ubot !! get use report for www.test.com

Sample Interaction

NPM Module

https://www.npmjs.com/package/hubot-bangbang