A little tool to dynamically update .env files.
npm install upsert-env```
$ npm install --save upsert-env
* key-value-object - object - required
* Ex: {'ENVVARKEY':'envvarvalue'}./.env
* Notes: Multiples are allowed, and it does not matter whether the the variable currently exists or not.
* path - string - optional
* Default: ./my-new-directory/.env
* Ex: function(error, data){ / do something */ }
* callback - function - optional
* Returns: error, data
Ex:
`js
var upsertEnv = require('upsert-env');
var newEnvVars = {
'MYNEWKEY':'a new value',
'ANOTHERNEWKEY':'another new value'
};
upsertEnv.set(newEnvVars, null, function(error, data){
if (error) console.log('Uh oh. ' + error);
else console.log('Success!', data);
});
``