.verb.md

December 31, 2016 ยท View on GitHub

Heads up!

Please read the release history, there were breaking changes in 1.0.0!

Usage

var read = require('read-data');

// sync
console.log(read.sync('foo.yml'));
console.log(read.sync('foo.yaml'));
console.log(read.sync('foo.json'));

// async
read('foo.yml', function(err, data) {
  if (err) return console.log(err);
  console.log(data);
});
read('foo.yaml', function(err, data) {
  if (err) return console.log(err);
  console.log(data);
});
read('foo.json', function(err, data) {
  if (err) return console.log(err);
  console.log(data);
});

API

{%= apidocs("index.js") %}

History

1.0.0

Breaking changes

  • The main export is now a function
  • Use read() instead of read.data()
  • Use read.sync() instead of read.data.sync()

Everything else is the same.