yamlop
v0.1.0
Published
One-way data-binding for YAML files, based on typicode/jsop
Downloads
1
Readme
yamlop
One-way data binding for YAML files
yamlop is a yaml version of [typicode/jsop], is a new kind of JSON file reader/writer powered by Object.observe (requires Node 0.11.13 or io.js 1.0.0).
Before
var fs = require('fs')
var yaml = require('js-yaml')
var config = yaml.safeLoad(fs.readFileSync('config.json','utf-8'))
config.foo = 'bar'
fs.writeFile('config.json', yaml.safeDump(config), function(err) {
if (err) throw err
})
After
var yamlop = require('yamlop')
var config = yamlop('config.yaml')
config.foo = 'bar'
License
MIT
* jsop is short for jsonOpen, yamlop naturally follows the same rule