Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

env-cmd

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-cmd

Executes a command using the envs in the provided env file

  • 8.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1M
increased by7.84%
Maintainers
1
Weekly downloads
 
Created

What is env-cmd?

The env-cmd npm package allows you to easily set environment variables from a file or inline before running a command. This is particularly useful for managing different environments (development, testing, production) without hardcoding environment variables in your code.

What are env-cmd's main functionalities?

Load environment variables from a file

This feature allows you to load environment variables from a specified file before running your command. The file should follow the standard .env format.

env-cmd -f ./path/to/.env node app.js

Load environment variables from multiple files

You can load environment variables from multiple files. This is useful for layering configurations, such as having a base configuration and an environment-specific override.

env-cmd -f ./path/to/.env -f ./path/to/.env.local node app.js

Inline environment variables

This feature allows you to set environment variables inline directly in the command. This is useful for quick tests or temporary overrides.

env-cmd -e 'NODE_ENV=production' node app.js

JSON configuration

You can also pass environment variables as a JSON object. This is useful for more complex configurations that might be easier to manage in JSON format.

env-cmd -e '{"NODE_ENV": "production", "API_KEY": "12345"}' node app.js

Other packages similar to env-cmd

Keywords

FAQs

Package last updated on 24 Apr 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc