read-data 
Utils for reading JSON and YAML data files.
Install
Install with npm:
npm i read-data --save
api
JSON
readJSON
Read JSON files asynchronously.
var file = require('read-data');
file.readJSON('foo.json', callback);
readJSONSync
Read JSON files synchronously.
var file = require('read-data');
file.readJSONSync('foo.json');
YAML
readYAML
Read YAML files asynchronously.
var file = require('read-data');
file.readYAML('foo.yaml', callback);
readYAMLSync
Read YAML files synchronously.
var file = require('read-data');
file.readYAMLSync('foo.yaml');
Data (automatic)
Automatically read a JSON or YAML data file based on its file extension.
readData
Read JSON or YAML files asynchronously.
var file = require('read-data');
file.readData('foo.json', callback);
file.readData('foo.yml', callback);
readDataSync
Read JSON or YAML files synchronously.
var file = require('read-data');
file.readDataSync('foo.json');
file.readDataSync('foo.yml');
lang
With the readData
methods, you can also explicitly set the language to read by passing a lang
option as a second parameter.
file.readDataSync('foo.json', {lang: 'json'});
This is useful if you need to set this value dynamically.
Authors
Jon Schlinkert
Brian Woodward
License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on April 09, 2014.