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

stack-env

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stack-env

flexiable configuring env

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

stack-env

NPM

npm package NPM downloads Average time to resolve an issue

What problem it tries to resolve

create-react-app provides the basic mechanism to differentiate development and production env, but it lacks the capability of dividing multiple 'production' env. Let's say there are qa, stg, prod, three stacks, we are not able to give different env variables per stack like Spring-Profile. Here I want to introduce stack-env which means to resolve this pain point.

Get started

The major concept in stack-env is stack and corresponding env files. e.g., stacks: qa, stg, prod, files: senv.qa, senv.stg, senv.prod

When stack-env runs, it read the stack from process.env to recognize what the exact stack it runs on. And then read the corresponding env file and load it as the env variables. In the end, the desired command runs in an env that all env variables come from the env file.

Usage

  Usage: senv [options] [command]
  
  Commands:
    help     Display help
    version  Display version
  
  Options:
    -c, --cmd      The command to run
    -f, --file     Choose an env file
    -h, --help     Output usage information
    -k, --key      Stack key
    -v, --verbose  Print full logs
    -V, --version  Output the version number

e.g. load env and run command yarn build.

senv -c 'yarn build'

Alias

What if the injected stack key is not 'stack' but others. stack-env provides a simple configuration section which is located in package.json to give an alias of the key.

"senv": {
  "key": "any-key"
}

Or through the cmd.

stack-env -k 'any-key' -c 'other commands'

LICENSE

MIT

Keywords

FAQs

Package last updated on 04 Dec 2019

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