Loads multiple environment variables from properties file
npm install propsenv``bash`with npm
npm install propsenv
or with Yarn
yarn add propsenv
As early as possible in your application, require and configure propsenv.
`default
require('propsenv')()
Create a
env_ file in the root/env/ directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE. For example:`
HOST=localhost.local
USER=root
PASS=pass
ARRAY=1,item,3, true
`You can also create multiple
env_ file in the directory.`
/env
env_dev.properties
env_test.properties
env_prod.properties
`Then execute your start script before with NODE_ENV=, you will get the configured variables in to env_.properties file by process.env.HOST, process.env.USER, process.env.PASS
`
NODE_ENV=test node your_script.js
``