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-env

v0.0.2

Published

Hubot manages environment variables in process.env and redis

Readme

hubot-env

NPM

Hubot manages environment variables dynamically in process.env and redis.

  • load environment variables in process.env.
  • store environment variables in redis.
  • reload environment variables from redis to process.env in restarting hubot.
  • flush all environment variables previously loaded via commands in process.env and redis.

If you use hubot-aws for example, you can switch environment variables about AWS Account Credentials via hubot command dynamically.

Installation

Add hubot-env to your package.json file:

npm install --save hubot-env

Add hubot-env to your external-scripts.json:

["hubot-env"]

Run npm install

Commands

hubot env current - Displays all current environment variables
hubot env current --prefix=[prefix] - Displays current environment variables with prefix
hubot env file - List name of files under HUBOT_ENV_BASE_PATH
hubot env flush all - Flush all current environment variables in process.env and redis
hubot env flush all --dry-run - Try flushing all current environment variables in process.env and redis
hubot env load --filename=[filename] - Loads [filename] of environment variables in process.env and redis
hubot env load --filename=[filename] --dry-run - Try loading [filename] of environment variables in process.env and redis

Configuration

Set environment variables like an example below.

export HUBOT_ENV_BASE_PATH="${HOME}/example"
export HUBOT_ENV_HIDDEN_WORDS="SECRET_ACCESS_KEY,PASSWORD,TOKEN,API_KEY"

You can parepare your own env files by referring to the example files.

Examples

Display current environment variables. You can limit to output with a prefix.

hubot> hubot env current --prefix=HUBOT
HUBOT_GITHUB_TOKEN=***
HUBOT_ENV_HIDDEN_WORDS=SECRET_ACCESS_KEY,PASSWORD,TOKEN,API_KEY
HUBOT_AUTH_ADMIN=ADMIN
HUBOT_ENV_BASE_PATH=files/env
HUBOT_GITHUB_REPO=yoheimuta/hubot-env
HUBOT_CONCURRENT_REQUESTS=20

Display env files under HUBOT_ENV_BASE_PATH. You can select one in this list to load.

hubot> hubot env file
aws-cred-account1.env
aws-cred-account2.env

Load new environment variables abount AWS credentials of account 1.

hubot> hubot env load --filename=aws-cred-account1.env
Loading env --filename=aws-cred-account1.env, --dry-run=false...
HUBOT_AWS_CREDENTIALS=account1
HUBOT_AWS_ACCESS_KEY_ID=ACCESS_KEY1
HUBOT_AWS_SECRET_ACCESS_KEY=***
HUBOT_AWS_REGION=ap-northeast-1

Then, Switch to overwrite environment variables abount AWS credentials of account 2.

hubot> hubot env load --filename=aws-cred-account2.env
Loading env --filename=aws-cred-account2.env, --dry-run=false...
HUBOT_AWS_CREDENTIALS=account2
HUBOT_AWS_ACCESS_KEY_ID=ACCESS_KEY2
HUBOT_AWS_SECRET_ACCESS_KEY=***
HUBOT_AWS_REGION=ap-northeast-1

Reload environment variables when restarting hubot.

$ ./bin/hubot
hubot>
[Sun May 10 2015 16:19:20 GMT+0900 (JST)] INFO Using default redis on localhost:6379
[Sun May 10 2015 16:19:20 GMT+0900 (JST)] INFO Data for hubot brain retrieved from Redis
hubot env bootstrap loaded HUBOT_AWS_CREDENTIALS => account2
hubot env bootstrap loaded HUBOT_AWS_ACCESS_KEY_ID => ACCESS_KEY2
hubot env bootstrap loaded HUBOT_AWS_SECRET_ACCESS_KEY => ***
hubot env bootstrap loaded HUBOT_AWS_REGION => ap-northeast-1

hubot>

Flush all loaded environment variables.

# Dry-run
hubot> hubot env flush all --dry-run
Flushing all --dry-run=true...
Complete dry-run: loadedData={
  HUBOT_AWS_CREDENTIALS: 'account2',
  HUBOT_AWS_ACCESS_KEY_ID: 'ACCESS_KEY2',
  HUBOT_AWS_SECRET_ACCESS_KEY: '***',
  HUBOT_AWS_REGION: 'ap-northeast-1' }

# Flush all
hubot> hubot env flush all
Flushing all --dry-run=false...
Complete flushing all

# Confirm to be flushed data in redis and process.env
hubot> hubot brain show storage --key=_private.hubot-env
null
hubot> hubot env current --prefix=HUBOT
HUBOT_GITHUB_TOKEN=***
HUBOT_ENV_HIDDEN_WORDS=SECRET_ACCESS_KEY,PASSWORD,TOKEN,API_KEY
HUBOT_AUTH_ADMIN=ADMIN
HUBOT_ENV_BASE_PATH=files/env
HUBOT_GITHUB_REPO=yoheimuta/hubot-env
HUBOT_CONCURRENT_REQUESTS=20

Recommended Usage

Use hubot-brain-inspect

hubot-brain-inspect displays data saved in redis with specifying by keys.

hubot> hubot brain show storage --key=_private.hubot-env
{ env:
   { HUBOT_AWS_CREDENTIALS: 'account2',
     HUBOT_AWS_ACCESS_KEY_ID: 'ACCESS_KEY2',
     HUBOT_AWS_SECRET_ACCESS_KEY: '***',
     HUBOT_AWS_REGION: 'ap-northeast-1' } }