node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

envvars

envvars Build Status js-standard-style

Parse exported environment variables from a string

Install

$ npm install --save envvars

Usage

$ cat .env
export FOO=foo
export FOO_BAR=bar
export BAR_FOO="baz"
var envVars = require('envvars');
 
fs.readFile('.env', 'utf8', function (content) {
  var result = envVars(content)
  // => {foo: 'foo', fooBar: 'bar', barFoo: 'baz'} 
})

API

envVars(input)

input

Required
Type: string

The string with the exported variables

License

MIT © Jeduan Cornejo