shellvarparser
v0.0.3
Published
Parse shell constant variables into a Javascript object.
Downloads
4
Readme
shellVarParser
Parse shell constant variables into a Javascript object.
Convert the contents of a shell constant variables file to a JavaScript object literal.
.env file
ENV_VAR1=foobar
ENV_VAR2=bazbang
js file
var shellVarParser = require('shellVarParser');
var fileContents = fs.readFileSync(__dirname + '/.env', 'utf8');
var envVars = shellVarParser.parse(fileContents)
// returns {ENV_VAR1: "foobar", ENV_VAR2: "bazbang"}
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Running tests
npm install
npm test