Nested Public Modules

    jsop

    0.3.1 • Public • Published

    jsop

    One-way data binding for JSON files

    jsop is a new kind of JSON file reader/writer for Node 0.12 and io.js 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

    Keywords

    Install

    npm i jsop

    DownloadsWeekly Downloads

    21

    Version

    0.3.1

    License

    MIT

    Last publish

    Collaborators

    • typicode