1.1.0 • Published 6 years ago

env-switcher v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

.ENV-SWITCHER

EASY SWICHING .ENV FILES

If you apply .env modules to your service, .env files need to be handled . As you divide your service into micro services, .env files are getting more like tribbles. I hope you can manage your envs easily without any mistakes with this cli.

Install

$ npm install -g env-switcher

Setting your project up

Move into your project directory. 1. Initialize env-switcher for your project.

$ envswitch init <env_name>
  • you can run without env_name parameter, then your default name of env setting is: 'default'
$ envswitch init
  • Then .envswitcher will be automatically added to .gitignore if it exists.
  • For ElasticBeanstalk users: it should be added to .ebignore manually.
  1. Put env files into .envswitcher. example:
.envswitcher
|-dev
|-prod
|-...

You can choose any names as your own envs.

Usage

$ envswitch use <env_name>

For example, you wanna change your .env files as development environment.
(When you made your own env files dev in .envswitcher.)

$ envswitch use dev

Put the command below to swtich environment as production.

$ envswitch use prod

And you wanna change environment to mytest

$ envswitch use mytest

More Commands

- list your env files
$ envswitch list
- update .env file as <env_name> if you modified it
$ envswitch update <env_name>
- check the status of your environment
$ envswitch status
- help
$ envswitch --help

Update Log

v1.1.0

  • add a command update <env_name>