0.1.0 • Published 9 years ago

yamlop v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

yamlop npm.io npm.io npm.io npm.io

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