shellvarparser

0.0.3 • Public • Published

shellVarParser

Build Status

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Running tests

npm install
npm test

Readme

Keywords

none

Package Sidebar

Install

npm i shellvarparser

Weekly Downloads

2

Version

0.0.3

License

none

Last publish

Collaborators

  • createbang