JSON file reader/writer (powered by Object.observe)
JavaScript
Latest commit 453b5d7 Oct 15, 2015 @typicode Update README.md
Permalink
Failed to load latest commit information.
.gitignore Initial commit Aug 2, 2014
.travis.yml Update Travis to Node 0.12 Feb 10, 2015
LICENSE Initial commit Aug 2, 2014
README.md
index.js Syntax Apr 9, 2015
package.json 0.3.1 Apr 9, 2015
test.js False positive test Apr 9, 2015

README.md

jsop

One-way data binding for JSON files

jsop is a JSON file reader/writer powered by Object.observe.

Before

var fs = require('fs')

var config = JSON.parse(fs.readFileSync('config.json'))
config.foo = 'bar'
fs.writeFile('config.json', JSON.stringify(config), function(err) {
  if (err) throw err
})

After

var jsop = require('jsop')

var config = jsop('config.json')
config.foo = 'bar'

Changes are automatically written to file. If file doesn't exist, it will be created.

License

MIT - Typicode

* jsop is short for jsonOpen