{"_id":"read-data","_rev":"11-7e2583143ef6540ddd1692b9a09b0acf","name":"read-data","description":"Read JSON or YAML files.","dist-tags":{"latest":"1.1.0"},"versions":{"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","tarball":"https://registry.npmjs.org/read-data/-/read-data-0.1.0.tgz","integrity":"sha512-BycOtgP1tgKDkKeZfySI3kiax5pikzeB2hO9W6mu/uA3A6cF93vFQ/A4POjJjoz5SmNO+zxsRATkCq/Xcpeu4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSS9c0tjL8WOLnpBN+q6Vtg5gNWp2JSAZJvoz0In9hxgIhANTFhCgjXyRTxjKD9pCVVOZPKV0P75fPn+NR34NeuN7h"}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}]},"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","tarball":"https://registry.npmjs.org/read-data/-/read-data-0.1.1.tgz","integrity":"sha512-muze2YG6kyyglN+Kn8maRSQRbUQOavmYV53iMGUyry1pDVsj3LijtzkCfCs2Fq9rQ2gouLJgLcb1kpNSTn0wwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKzq5qMgpw1GDlQZJY5/xRJ43pCZQFtw02QuZd9tMxIwIhAN1HxJatQdNaHyHsAE8DCbrRKeAHo3H2cvGDdVb2SFZJ"}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}]},"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","tarball":"https://registry.npmjs.org/read-data/-/read-data-0.2.0.tgz","integrity":"sha512-7zyZYfXw1ZJc2+DFrfi82+97iwNLtqX77OjxvsoFp0oQRwnR4bfAyTElSy2sj+iYG2g0moE51dU0GxanIdhStQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOo4JnGBhmSG2ada3Z2m4p4K0oVnwXXcYq9tkGU3DaJAiAKM/rYcJ8/aqJWntGLsKBmjIFtfYCvFaDKNU5Nzz2xdQ=="}]}},"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","tarball":"https://registry.npmjs.org/read-data/-/read-data-0.3.0.tgz","integrity":"sha512-JVIQPJF+IRo8LbDVuq/jFwB5B+fURTVR4B3orxQidpN64Lt3Mn+2UZwbyeq3j9LbcGYl4hbCMqr82qSOfsqIOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDp4MgDwbsxsTpjchK40POBdoomds8Hv/OT0tiDjhya3wIhAKfVrxIYuFGaF+HKOqDuWL4jhJpRzZc0Ri59d5l3TNe0"}]}},"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","tarball":"https://registry.npmjs.org/read-data/-/read-data-1.0.0.tgz","integrity":"sha512-ZzqfTbX5hn7RGcMv3m1MxTR9ktMOcrONEN+Uw4od0IzE5ht56oOzoeaoEh770BEZy0cOBuv3rdou0r/LkvPAdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8yF49c2q0Td/BYqcqkx6dFfYYjHIMmTDPropDxXryvAiEAggcjt7wsHwok5qVMfrVNYv0yviLqS7+0valYM+GV/wQ="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/read-data-1.0.0.tgz_1483142875430_0.13052561390213668"}},"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","tarball":"https://registry.npmjs.org/read-data/-/read-data-1.1.0.tgz","integrity":"sha512-Zk0iVB+I2Yhkk2i9sRbOpf7P6MYztl/LCSDO0e5OiliRE0Akx+w5AprOgXTo0thq0WltssqDkdZv9iWUuvOQ9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID7RJEaigh5FVB1xBNLh8PcH8e+wND0m5spaWoX7ICLtAiEAslsxraO+BKseToX3hXR1nS9xWC8AnTFSuTLKYDjrpEs="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/read-data-1.1.0.tgz_1491168184388_0.4638700208161026"}}},"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._","maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-26T09:13:05.654Z","created":"2014-04-09T19:47:38.270Z","0.1.0":"2014-04-09T19:47:38.270Z","0.1.1":"2014-04-09T20:48:09.623Z","0.2.0":"2014-10-24T07:53:49.431Z","0.3.0":"2015-03-31T10:54:50.714Z","1.0.0":"2016-12-31T00:07:56.019Z","1.1.0":"2017-04-02T21:23:06.329Z"},"homepage":"https://github.com/jonschlinkert/read-data","keywords":["async","data","file","fs","json","read","reader","sync","system","yaml"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/read-data.git"},"author":{"name":"Jon Schlinkert","url":"http://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/read-data/issues"},"readmeFilename":"README.md","license":"MIT","contributors":[{"name":"Charlike Mike Reagent","url":"https://i.am.charlike.online"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}]}