{"_id":"read-data","_rev":"58750","name":"read-data","description":"Read JSON or YAML files.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:18:10.000Z","created":"2014-04-09T19:47:38.270Z","1.1.0":"2017-04-02T21:23:06.329Z","1.0.0":"2016-12-31T00:07:56.019Z","0.3.0":"2015-03-31T10:54:50.714Z","0.2.0":"2014-10-24T07:53:49.431Z","0.1.1":"2014-04-09T20:48:09.623Z","0.1.0":"2014-04-09T19:47:38.270Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"http://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/read-data.git"},"versions":{"1.1.0":{"name":"read-data","description":"Read JSON or YAML files.","version":"1.1.0","homepage":"https://github.com/jonschlinkert/read-data","author":{"name":"Jon Schlinkert","url":"http://github.com/jonschlinkert"},"contributors":[{"name":"Charlike Mike Reagent","url":"https://i.am.charlike.online"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/read-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">= 0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"extend-shallow":"^2.0.1","read-yaml":"^1.1.0"},"devDependencies":{"gulp-format-md":"^0.1.11","js-yaml":"^3.8.2","mocha":"^3.2.0"},"keywords":["async","data","file","fs","json","read","reader","sync","system","yaml"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["read-yaml","write","copy"]},"reflinks":["js-yaml","verb","verb-generate-readme"],"lint":{"reflinks":true}},"gitHead":"0d9636f9d1d064d57fd0d0e2948bcbd77ba8acfd","_id":"read-data@1.1.0","_shasum":"01014cc4f307f238d57d8ea3d5c8e593ce83d9f9","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"01014cc4f307f238d57d8ea3d5c8e593ce83d9f9","size":3711,"noattachment":false,"key":"/read-data/-/read-data-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-data/download/read-data-1.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/read-data-1.1.0.tgz_1491168184388_0.4638700208161026"},"directories":{},"publish_time":1491168186329,"_hasShrinkwrap":false,"_cnpm_publish_time":1491168186329},"1.0.0":{"name":"read-data","description":"Read JSON or YAML files.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/read-data","author":{"name":"Jon Schlinkert","url":"http://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/read-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">= 0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"extend-shallow":"^2.0.1","read-yaml":"^1.0.0"},"devDependencies":{"gulp-format-md":"^0.1.11","js-yaml":"^3.7.0","mocha":"^3.2.0"},"keywords":["async","data","file","fs","json","read","reader","sync","system","yaml"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true},"related":{"list":[]},"reflinks":["js-yaml","verb","verb-generate-readme"]},"gitHead":"836c7934560c51e8da4bb40e362ec3236e7d06e8","_id":"read-data@1.0.0","_shasum":"c2254edb70e0767ec5e6766aa89d061d23920b64","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"c2254edb70e0767ec5e6766aa89d061d23920b64","size":3405,"noattachment":false,"key":"/read-data/-/read-data-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-data/download/read-data-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/read-data-1.0.0.tgz_1483142875430_0.13052561390213668"},"directories":{},"publish_time":1483142876019,"_cnpm_publish_time":1483142876019,"_hasShrinkwrap":false},"0.3.0":{"name":"read-data","description":"Read JSON or YAML files.","version":"0.3.0","homepage":"https://github.com/jonschlinkert/read-data","author":{"name":"Jon Schlinkert","url":"http://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/read-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/read-data/blob/master/LICENSE"},"files":["index.js"],"scripts":{"test":"mocha"},"dependencies":{"read-yaml":"^1.0.0"},"devDependencies":{"js-yaml":"^3.2.7","mocha":"^2.2.1","should":"^5.2.0"},"keywords":["async","data","file","fs","json","read","reader","sync","system","yaml"],"gitHead":"441c7836cda224e408a9b92d610419e59ff75f3e","_id":"read-data@0.3.0","_shasum":"7210719238cc21048e88b61b8be721a7cdf7f2da","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"7210719238cc21048e88b61b8be721a7cdf7f2da","size":3013,"noattachment":false,"key":"/read-data/-/read-data-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-data/download/read-data-0.3.0.tgz"},"directories":{},"publish_time":1427799290714,"_cnpm_publish_time":1427799290714,"_hasShrinkwrap":false},"0.2.0":{"name":"read-data","description":"Utils for reading JSON and YAML data files.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/read-data","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/read-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/read-data/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha -R test"},"devDependencies":{"should":"^4.1.0","verb":"^0.2.15","verb-tag-jscomments":"^0.2.2"},"dependencies":{"async":"^0.9.0","graceful-fs":"^3.0.4","js-yaml":"^3.2.2"},"keywords":["data","file","filepath","fs","json","parse","read","system","yaml"],"_id":"read-data@0.2.0","_shasum":"90a63688eaf488392f5b2968f6e8e108b8324114","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"90a63688eaf488392f5b2968f6e8e108b8324114","size":3715,"noattachment":false,"key":"/read-data/-/read-data-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-data/download/read-data-0.2.0.tgz"},"directories":{},"publish_time":1414137229431,"_cnpm_publish_time":1414137229431,"_hasShrinkwrap":false},"0.1.1":{"name":"read-data","description":"Utils for reading JSON and YAML data files.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/read-data","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/read-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/read-data/blob/master/LICENSE-MIT"}],"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha -R test"},"devDependencies":{"verb":"~0.2.0","chai":"~1.9.1"},"dependencies":{"async":"~0.7.0","graceful-fs":"~2.0.3","js-yaml":"~3.0.2"},"_id":"read-data@0.1.1","dist":{"shasum":"afb9a0ae5d66cf43891f300b59a127df7b2d6013","size":3909,"noattachment":false,"key":"/read-data/-/read-data-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-data/download/read-data-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1397076489623,"_cnpm_publish_time":1397076489623,"_hasShrinkwrap":false},"0.1.0":{"name":"read-data","description":"Utils for reading JSON and YAML data files.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/read-data","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/read-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/read-data/blob/master/LICENSE-MIT"}],"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha -R test"},"devDependencies":{"verb":"~0.2.0","chai":"~1.9.1"},"dependencies":{"async":"~0.7.0","graceful-fs":"~2.0.3","js-yaml":"~3.0.2"},"_id":"read-data@0.1.0","dist":{"shasum":"0be8678c608c358a308626b305069dd0d41da71f","size":3284,"noattachment":false,"key":"/read-data/-/read-data-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-data/download/read-data-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1397072858270,"_cnpm_publish_time":1397072858270,"_hasShrinkwrap":false}},"readme":"# read-data [![NPM version](https://img.shields.io/npm/v/read-data.svg?style=flat)](https://www.npmjs.com/package/read-data) [![NPM monthly downloads](https://img.shields.io/npm/dm/read-data.svg?style=flat)](https://npmjs.org/package/read-data)  [![NPM total downloads](https://img.shields.io/npm/dt/read-data.svg?style=flat)](https://npmjs.org/package/read-data) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/read-data.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/read-data)\n\n> Read JSON or YAML files.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save read-data\n```\n\n**Heads up!**\n\nPlease read the [release history](#history), there were breaking changes in 1.0.0!\n\n## Usage\n\n```js\nvar read = require('read-data');\n\n// sync\nconsole.log(read.sync('foo.yml'));\nconsole.log(read.sync('foo.yaml'));\nconsole.log(read.sync('foo.json'));\n\n// async\nread('foo.yml', function(err, data) {\n  if (err) return console.log(err);\n  console.log(data);\n});\nread('foo.yaml', function(err, data) {\n  if (err) return console.log(err);\n  console.log(data);\n});\nread('foo.json', function(err, data) {\n  if (err) return console.log(err);\n  console.log(data);\n});\n```\n\n## API\n\n### [read](index.js#L41)\n\nAsynchronously read a JSON or YAML file, automatically determining the reader based on extension.\n\n**Params**\n\n* `filepath` **{String}**: path of the file to read.\n* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml)\n* `cb` **{Function}**: callback function\n* `returns` **{Object}**: JSON\n\n**Example**\n\n```js\nvar read = require('read-data');\n\nread('foo.json', function(err, data) {\n  if (err) throw err;\n  console.log(data);\n});\n\nread('foo.yml', function(err, data) {\n  if (err) throw err;\n  console.log(data);\n});\n```\n\n### [.sync](index.js#L70)\n\nSynchronously read a `.json` or `.(yaml|yml)` file, automatically determining the reader based on extension.\n\n**Params**\n\n* `filepath` **{String}**: path of the file to read.\n* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml)\n* `returns` **{Object}**: JSON\n\n**Example**\n\n```js\nvar data = require('read-data').data;\n\nvar yaml = data.sync('foo.yml');\nvar json = data.sync('foo.json');\n```\n\n### [.yaml](index.js#L96)\n\nAsynchronously read a YAML file.\n\n**Params**\n\n* `filepath` **{String}**: path of the file to read.\n* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml)\n* `cb` **{Function}**: callback function\n* `returns` **{Object}**: JSON\n\n**Example**\n\n```js\nvar yaml = require('read-data').yaml;\n\nyaml('foo.yml', function(err, data) {\n  if (err) throw err;\n  console.log(data);\n});\n```\n\n### [.yaml.sync](index.js#L113)\n\nSynchronously read a YAML file.\n\n**Params**\n\n* `filepath` **{String}**: path of the file to read.\n* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml)\n* `returns` **{Object}**: JSON\n\n**Example**\n\n```js\nvar yaml = require('read-data').yaml;\nvar data = yaml.sync('foo.yml');\n```\n\n### [.json](index.js#L134)\n\nAsynchronously read a JSON file.\n\n**Params**\n\n* `filepath` **{String}**: path of the file to read.\n* `callback` **{Function}**: callback function\n* `returns` **{Object}**: JSON\n\n**Example**\n\n```js\nvar json = require('read-data');\n\njson('foo.json', function(err, data) {\n  if (err) throw err;\n  console.log(data);\n});\n```\n\n### [.json.sync](index.js#L166)\n\nSynchronously read a JSON file.\n\n**Params**\n\n* `filepath` **{String}**: path of the file to read.\n* `returns` **{Object}**: JSON\n\n**Example**\n\n```js\nvar json = require('read-data').json;\nvar data = json.sync('foo.json');\n```\n\n## History\n\n### 1.0.0\n\n**Breaking changes**\n\n* The main export is now a function\n* Use `read()` instead of `read.data()`\n* Use `read.sync()` instead of `read.data.sync()`\n\nEverything else is the same.\n\n## About\n\n### Related projects\n\n* [copy](https://www.npmjs.com/package/copy): Copy files or directories using globs. | [homepage](https://github.com/jonschlinkert/copy \"Copy files or directories using globs.\")\n* [read-yaml](https://www.npmjs.com/package/read-yaml): Very thin wrapper around js-yaml for directly reading in YAML files. | [homepage](https://github.com/jonschlinkert/read-yaml \"Very thin wrapper around js-yaml for directly reading in YAML files.\")\n* [write](https://www.npmjs.com/package/write): Write files to disk, creating intermediate directories if they don't exist. | [homepage](https://github.com/jonschlinkert/write \"Write files to disk, creating intermediate directories if they don't exist.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 14 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 1 | [tunnckoCore](https://github.com/tunnckoCore) |\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](http://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on April 02, 2017._","_attachments":{},"homepage":"https://github.com/jonschlinkert/read-data","bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"license":"MIT"}