0.0.3 • Published 1 year ago

env-state v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

env-state

env-state is a simple tool for managing environment variables. It allows you to edit .env files with different configurations for each environment.

Installation

You can install env-state via npm:

npm install -g env-state

To use env-state, run the following command:

npx env-state [state] [env-state]

Where state represents the state to be set in the .env file, and environment specifies the environment to be edited.

For example, running the following command:

npx env-state state dev

Will edit a .env file with settings for the dev state. If a .env file already exists, the settings for the specified state will be updated in the existing file.

Example

Consider the following .env file:

#.env file
#env_state=dev(
##THIS IS DEV ENV
#DATA_URL = google.com
DATA_URL2 = naver.com
#)

#env_state=local(
##THIS IS LOCAL ENV
#DATA_URL = naver.com
DATA_URL2 = google.com
#)
APP_URL = android.com
#CUSTOM_URL = daum.net

Executing the above command will activate only the settings for the dev state, commenting out settings for other states:

#.env file
#env_state=dev(
##THIS IS DEV ENV
DATA_URL = google.com
DATA_URL2 = naver.com
#)

#env_state=local(
##THIS IS LOCAL ENV
#DATA_URL = naver.com
#DATA_URL2 = google.com
#)
APP_URL = android.com
#CUSTOM_URL = daum.net
0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago