npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

env-cmd-multiple

v1.0.0

Published

Executes a command using the envs in the provided env file

Downloads

46

Readme

Travis Coveralls npm npm npm Standard - JavaScript Style Guide

env-cmd

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

Install

npm install env-cmd or npm install -g env-cmd

Usage

Environment File 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

# Surround value in double quotes when using a # symbol in the value
ENV4="ValueContains#Symbol"

# If using double quotes as part of the value, you must surround the value in double quotes
ENV5=""Value includes double quotes""

Package.json

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

or

Terminal

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

.rc file usage

.rc file .env-cmdrc

{
  "development": {
    "ENV1": "Thanks",
    "ENV2": "For All"
  },
  "production": {
    "ENV1": "The Fish"
  }
}

Terminal

./node_modules/.bin/env-cmd production 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
  • JavaScript file exporting an object
  • .env-cmdrc file (as valid json) in execution directory

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!

Related Projects

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
  • Jon Scheiding

Contributing Guide

I welcome all pull requests. Please make sure you add appropriate test cases for any features added. Before opening a PR please make sure to run the following scripts:

  • npm run lint checks for code errors and formats according to js-standard
  • npm test make sure all tests pass
  • npm run test-cover make sure the coverage has not decreased from current master