Socket
Socket
Sign inDemoInstall

env-cmd

Package Overview
Dependencies
6
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    env-cmd

Executes a command using the envs in the provided env file


Version published
Weekly downloads
949K
decreased by-0.72%
Maintainers
1
Install size
84.9 kB
Created
Weekly downloads
 

Changelog

Source

2.0.0

  • BREAKING: Removed the -e and --env flags. Now it just expects the first arg to env-cmd to be the relative path to the env file: env-cmd env_file command carg1 carg2
  • Change: ParseEnvFile is now more properly named ParseEnvString
  • Feature: ParseEnvString will ignore comment lines (lines starting with #)
  • Feature: ParseEnvString will ignore empty lines in env file
  • Bug: ParseEnvString will extract the last line even if no newline (\n) exists on it

Readme

Source

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).

Keywords

FAQs

Last updated on 17 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc