dashenv
v1.1.0
Published
Set your env variables, client/server side.
Downloads
17
Maintainers
Readme
@codhek/dashenv
npm i dashenvHow to use ?
Save your environment variables in a file -env, pass your path to the -env file and also a callback function to get your environment variables.
Your -env file :
ENDPOINT=http://localhost:3000/graphql
SERVER=developmentUse it as follows in the file you want to use your environment variables :
const extract = require('dashenv');
const path = './env_vars/-env';
extract(path, function(env) {
console.log(env["ENDPOINT"]);
console.log(env["SERVER"]);
});