JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1428772
  • Score
    100M100P100Q191464F
  • License MIT

Executes a command using the envs in the provided env file

Package Exports

  • env-cmd

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (env-cmd) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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
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 ./test/.env mocha -R spec"
  }
}

or

Terminal

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

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 env data to a public git repo!

Special Thanks

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