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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hubot-conf

v2.0.1

Published

A configuration management system for Hubot

Readme

hubot-conf

A configuration management system for hubot.

The system has two parts:

For script implementers: It can be used by hubot script implementers to read configuration values, either ones that are dynamically set via chat or statically set via environment variables.

For users: It can also be used by hubot users to dynamically set (or override) configuration values through the chat interface.

Demo

Demo

Chat Interface (for users)

If you're using scripts that make use of hubot-conf, it's good to enable the chat interface so you can dynamically configure settings.

To do this, run the following command in your project repo:

npm install hubot-conf --save

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

[
  "hubot-conf"
]

To see how to use the chat interface, say {botname} help conf in the chat.

If you prefer to use environment variables for settings, you can do so. Configuration setting names are mapped as follows: property.path is mapped to the HUBOT_PROPERTY_PATH environment variable (replace . with _, make uppercase, and prepend with HUBOT_).

Configuration

  • HUBOT_CONF_HIDDEN - a comma-separated list of properties corresponding to environment variables that are hidden and not visible from the chat frontend.

Library (for script implementers)

If you're a script implementer, you can use hubot-conf as a library to read configuration values. The library supports both dynamically set values (through the chat interface) and statically set values (as environment variables). If the hubot user hasn't enabled the chat interface, the library will still work; it will just read statically set values.

Properties are of the form package.name.property.name, where individual components of the name are lowercase letters. Usually, the package name is a single word matching the script name. Individual property names depend on the script.

As an example, we will consider a fictional script example. When you use this library, users can configure settings like example.property (dynamically) or the corresponding HUBOT_EXAMPLE_PROPERTY (statically).

To use the library, run npm install hubot-conf --save in your project repository. Here is a sample use of the library:

module.exports = (robot) ->
  config = require('hubot-conf')('example', robot)

  robot.respond /hello/, (msg) ->
    # read the 'response.hello' property for the package 'example'
    #
    # it could be set by someone running something like
    #
    #     hubot conf set example.response.hello "Hello there!"
    #
    # or it could be set in the HUBOT_EXAMPLE_RESPONSE_HELLO environment
    # variable
    msg.send config('response.hello')

  robot.respond /goodbye/, (msg) ->
    # read the 'response.goodbye' property for the package 'example'
    #
    # this time, we have a fallback in case neither the config nor the
    # environment variable is set
    msg.send config('response.goodbye', "Goodbye.")

Here is an example transcript after setting the environment variable HUBOT_EXAMPLE_RESPONSE_HELLO='sup?' (and nothing else):

hubot> hubot hello
sup?
hubot> hubot goodbye
Goodbye.
hubot> hubot conf get example.response.hello
example.response.hello = `"sup?"` (environment variable)
hubot> hubot conf set example.response.goodbye ":("
example.response.goodbye = `":("`
hubot> hubot goodbye
:(

For more in-depth uses of the library, take a look at hubot-group and hubot-shortcut.

License

Copyright (c) 2015-2019 Anish Athalye. Released under the MIT License. See LICENSE.md for details.