ENVMAP
Map environment variables easily
You don't not have to do this -
GOOGLE_APP_ID: processenvGOOGLE_APP_IDGOOGLE_APP_SECRET: processenvGOOGLE_APP_SECRETGOOGLE_TOKEN: processenvGOOGLE_TOKENGOOGLE_CB_URL: processenvGOOGLE_CB_URL
Simply install envmap
from npm
$ npm install --save envmap
; const GOOGLE = envprefix'google_'; /*GOOGLE { app_id: '...', app_secret: '...', token: '...', cb_url: '...'}*/
env.prefix('')
takes in a parameter -- namespace prefix to use for environment variable lookups; on finding matching
environment variables, it'll return an object with the env variables lower-cased and stripped.