Skip to content

SImple node script to change between frontend environment variables

License

Notifications You must be signed in to change notification settings

klougod/set-environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

set-environment

Simple node script to change between frontend environments

Install

npm install set-environment

yarn add set-environment

Usage

Add envs folder to your root project folder (side by side with your package.json), then add your env files as you need e.g.

├── envs
│   ├── dev.json
│   ├── prod.json
│   ├── staging.json
│   └── test.json

then you need to add the env commands to your package.json scripts (note that the argument passed should be the same file name in your envs file)

"scripts": {
  "env:dev": "npm set-environment dev",
  "env:prod": "npm set-environment prod",
  "env:staging": "npm set-environment staging",
  "env:test": "npm set-environment test"
}

then, to change environments just:

npm env:dev
npm env:prod
npm env:staging
npm env:test

About

SImple node script to change between frontend environment variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published