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

json-to-heroku-env

v3.0.2

Published

Set remote Heroku environment variables from local exported JSON data.

Downloads

7

Readme

json-to-heroku-env

Set remote Heroku environment variables from local exported JSON data.

Upgrading from v1.X.X to v2.X.X? See the v1-to-v2-upgrade guide

Upgrading from v2.X.X to v3.X.X? v2-to-v3-upgrade guide in your face

json-to-heroku-env is a simple script that can be used to set remote Heroku environment variables from a local file.

To use json-to-heroku-env, you must have the Heroku CLI installed and be logged in.

Installation

NPM

npm install --save-dev json-to-heroku-env

(I imagine that you'll want to use this as a dev dependency, do what you will)

Usage

To use json-to-heroku-env, you'll need to create a .json_to_heroku_envrc.json file in your app's root directory. The JSON data in that file has two required keys, app and config - for example:

{
	"app": "my-heroku-app",
	"config": {
		"FOO": "greetings",
		"BAR": "friends"
	}
}

Then just include the following command in the NPM script of your choice in your package.json file:

json-to-heroku-env

for example, I like to roll:

"scripts": {
  "set-heroku-env-vars": "json-to-heroku-env"
}

The config keys and values from your JSON data will set the corresponding environment values in your remote Heroku app. The example above would set FOO and BAR as "greetings" and "my friends", respectively.

Note that the environment variables that you set via this script will either be created if they don't yet exist or overwritten if they do - as of now, this script has no destructive behaviors... although I'm considering such a thing for a future release.

Requirements

As noted above, you must have installed the Heroku CLI and be logged in for this module to work.

The current version of the Heroku CLI requires Node version 8.3.0 or greater - this has been set in the "engines" field in the package.json file.

Options

You can pass one optional flag into the json-to-heroku-env command, --response-verbose, which will log the status and headers from Heroku's response.

Notes

This module has been formatted according to ESLint's eslint-config-airbnb-base rules.