2016-08-16 21:50:21 -05:00
2016-08-16 21:34:05 -05:00
2016-08-16 20:00:47 -05:00
2016-08-16 20:00:47 -05:00
2016-08-16 21:34:05 -05:00
2016-08-16 21:34:05 -05:00

Travis Coveralls 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 Variables file (./test/.env)

ENV1=THANKS
ENV2=FORALL
ENV4=THEFISH

This is the only accepted format for an environment file. If other formats are desired please create an issue

package.json

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

or Terminal

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

Why

Because sometimes it just too cumbersome passing tons of environment variables to scripts. Its usually just easier to have a file with all the vars in them, especially for development. Do not commit sensitive data to public git!

Special Thanks

Special thanks to cross-env for inspiration.

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