Socket
Socket
Sign inDemoInstall

env-cmd

Package Overview
Dependencies
1
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
934K
decreased by-1.52%
Maintainers
1
Install size
85.7 kB
Created
Weekly downloads
 

Changelog

Source

2.1.0

  • Feature: Added support for key value mapping in env vars file
  • Feature: Added support for inline comments ENV=VALUE # inline comment
  • Change: Will now ignore invalid lines in env vars file instead of throwing an error
  • Change: Migrated all the parsing over to regex since the file format is simple enough right now to support that
  • Bug: Removed old test cases for the -e/--env flags that were not needed anymore

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 # 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

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

Keywords

FAQs

Last updated on 18 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