Todd Bluhm 288b5a506c
Publish version 2.2.0
- Update changelog
- Update package.json
2016-09-23 02:00:49 -04:00
2016-09-15 13:01:59 -04:00
2016-09-15 13:01:59 -04:00
2016-08-16 20:00:47 -05:00
2016-09-23 02:00:49 -04:00
2016-08-16 20:00:47 -05:00
2016-09-23 02:00:49 -04:00
2016-09-22 08:25:00 -04:00

Travis Coveralls npm npm npm

env-cmd

A simple node program for executing commands using an environment from an env file.

Install

npm install env-cmd

Usage

Environment file ./test/.env

# This is a comment
ENV1=THANKS # Yay inline comments support
ENV2=FOR ALL
ENV3 THE FISH # This format is also accepted

Package.json

{
  "scripts": {
    "test": "env-cmd ./test/.env mocha -R spec"
  }
}

or

Terminal

./node_modules/.bin/env-cmd ./test/.env node index.js

Environment File Formats

These are the currently accepted environment file formats. If any other formats are desired please create an issue.

  • key=value
  • key value
  • Key/value pairs as JSON

Why

Because sometimes its just too cumbersome passing lots of environment variables to scripts. Its usually just easier to have a file with all the vars in them, especially for development and testing.

Do not commit sensitive environment data to a public git repo!

cross-env - Cross platform setting of environment scripts

Special Thanks

Special thanks to cross-env for inspiration (use's the same cross-spawn lib underneath too).

Contributors

  • Eric Lanehart
Description
Setting environment variables from a file
Readme MIT 1.2 MiB
Languages
TypeScript 98%
JavaScript 2%