0.0.4 • Published 10 years ago

fsreadfileastype v0.0.4

Weekly downloads
24
License
-
Repository
github
Last release
10 years ago

fsReadFileAsType

Build Status

Parse the contents of files as JavaScript objects.

.env file

VAR1=foobar
VAR2=bazbang

.jsonfile file

{
  "foo": "bar",
  "baz": "bang"
}

js file

var fsReadFileAsType = require('fsreadfileastype');

var jsonData = fsReadFileAsType.sync(__dirname + '/.jsonfile', 'json');
// returns {foo: "bar", baz: "bang"}
var shellVarData = fsReadFileAsType.sync(__dirname + '/.env', 'shell');
// returns {VAR1: "foo", VAR2: "bar"}

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
0.0.4

10 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago