yamlop

0.1.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i yamlop

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • georgzoeller