{"_id":"write-data","_rev":"8-82c41eab7b0ada0a9cf46e4d6ce2918e","name":"write-data","description":"Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.","dist-tags":{"latest":"1.0.2"},"versions":{"0.1.0":{"name":"write-data","description":"Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/write-data","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/write-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/write-data/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"extend-shallow":"^1.1.2","lazy-cache":"^0.2.4","write-json":"^0.2.2","write-yaml":"^0.2.2"},"devDependencies":{"delete":"^0.2.1","mocha":"*","read-yaml":"^1.0.0","should":"*"},"keywords":["data","format","json","read","write","yaml"],"verb":{"related":{"list":["write-json","write-yaml","read-yaml","read-data"]}},"gitHead":"d09e199e9af7227abd6e4e201212600cbbdc28dd","_id":"write-data@0.1.0","_shasum":"a2fb8ffb2371bfd98137a77795e8d378a115c7a8","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"a2fb8ffb2371bfd98137a77795e8d378a115c7a8","tarball":"https://registry.npmjs.org/write-data/-/write-data-0.1.0.tgz","integrity":"sha512-/wHInU2QzhoeVEnQRAxBD234zLzl58W/at3313zOYuxH1rgqhwKPhPFa8gT845vSmedFjxZ6eECxk2Y7bPO+oQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCW8NsBtM/FsERqOJuM3Ov00iV4lFYHhjbkYrGNFru3GgIhAKts/VIgC3amd57jMqiBpMh2nMhRBtL6pcF1XQLbDXYZ"}]}},"1.0.0":{"name":"write-data","description":"Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/write-data","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/write-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/write-data/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"extend-shallow":"^2.0.1","isobject":"^3.0.0","write-json":"^1.0.1","write-yaml":"^1.0.0"},"devDependencies":{"delete":"^0.3.2","gulp-format-md":"^0.1.12","mocha":"^3.2.0","read-yaml":"^1.1.0"},"keywords":["data","format","json","read","write","yaml"],"verb":{"related":{"list":["read-data","read-yaml","write-json","write-yaml"]},"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"83bc5a0891f75a5e80c06f7e2cbb273d2cea3126","_id":"write-data@1.0.0","_shasum":"bf20311af55c2951c2ce5839cb62ec052aea8f0e","_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":"bf20311af55c2951c2ce5839cb62ec052aea8f0e","tarball":"https://registry.npmjs.org/write-data/-/write-data-1.0.0.tgz","integrity":"sha512-8KQg2kxcCW3CEFfOoVpWS8vv1HfIs2Z3NsrHXBsxtwJ8o+g15pUBhr/z/aziAvLsjjiydNELYfKSaxp2c5aE0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDb4ko+gW9rrXIbIArGSV+XgONCKTyjacqmje463BNetAiBko7qpAeX3VMrhPkAjui7X/xCk/QVAR6TBK/jSk2z27w=="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/write-data-1.0.0.tgz_1492054264134_0.42220807587727904"}},"1.0.1":{"name":"write-data","description":"Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.","version":"1.0.1","homepage":"https://github.com/jonschlinkert/write-data","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/write-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/write-data/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"extend-shallow":"^3.0.2","isobject":"^3.0.1","write-json":"^2.0.0","write-yaml":"^1.0.0"},"devDependencies":{"delete":"^1.1.0","gulp-format-md":"^1.0.0","mocha":"^3.5.3","read-yaml":"^1.1.0"},"keywords":["data","format","json","read","write","yaml"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["delete","read-data","read-yaml","write","write-json","write-yaml"]},"lint":{"reflinks":true}},"gitHead":"71cc4ba53a07b880e855fbf378d309eb023dbe12","_id":"write-data@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-9nW9GOgBHeR+8pACKenyQ3jRVoOkHEwDYfsvS3MNU6/7PajVJkm7rKX/vQNt+PpBPX/fxP4eSLseAYPSEGUvDA==","shasum":"45eea9e163347d634dc6067e6bbe611159197b6a","tarball":"https://registry.npmjs.org/write-data/-/write-data-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATxyGAf2sZSbTKZANbWiTZSedyx/1ALjogMYOi6lHfEAiAfXkfuQr5xgFLtathBDKp0WUp2VMJsxX4C/jdDiiZuzg=="}]},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-data-1.0.1.tgz_1517002928436_0.5232996572740376"}},"1.0.2":{"name":"write-data","description":"Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.","version":"1.0.2","homepage":"https://github.com/jonschlinkert/write-data","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/write-data.git"},"bugs":{"url":"https://github.com/jonschlinkert/write-data/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"extend-shallow":"^3.0.2","isobject":"^3.0.1","write-json":"^3.0.0","write-yaml":"^1.0.0"},"devDependencies":{"delete":"^1.1.0","gulp-format-md":"^1.0.0","mocha":"^3.5.3","read-yaml":"^1.1.0"},"keywords":["data","format","json","read","write","yaml"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["delete","read-data","read-yaml","write","write-json","write-yaml"]},"lint":{"reflinks":true}},"gitHead":"71cc4ba53a07b880e855fbf378d309eb023dbe12","_id":"write-data@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-WshXt2akMg2gaQk1mil3QspgOfGVuiWXzpNK9k4NuNfT0kR7zhsBzyToe6TNB5teA1tO7uGwp7Ren+nkCZy0XA==","shasum":"88b2624bccb65492d4a8750a955428b589e53ae2","tarball":"https://registry.npmjs.org/write-data/-/write-data-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEv25iNucIb/COud5h0yOX7EmegfgDpzdTZSKrT1ach0AiEA+tF9ttvOdsuOuVtzQudasktF6pTMFbhN86x448oZtTc="}]},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-data-1.0.2.tgz_1517003568386_0.7619388774037361"}}},"readme":"# write-data [![NPM version](https://img.shields.io/npm/v/write-data.svg?style=flat)](https://www.npmjs.com/package/write-data) [![NPM monthly downloads](https://img.shields.io/npm/dm/write-data.svg?style=flat)](https://npmjs.org/package/write-data) [![NPM total downloads](https://img.shields.io/npm/dt/write-data.svg?style=flat)](https://npmjs.org/package/write-data) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/write-data.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/write-data)\n\n> Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save write-data\n```\n\n## Usage\n\nAdd to your node.js application with the following line of code:\n\n```js\nvar writeData = require('write-data');\n\n// async\nwriteData(filepath, data[, options], function(err) {\n  // do stuff with \"err\"\n});\n\n// sync\nwriteData.sync(filepath, data[, options]);\n```\n\n## API\n\nThe file extension is used to detect the data format to write. This can be overriden by passing a value on `options.ext`.\n\n### YAML examples\n\n```js\nvar data = {language: 'node_js', node_js: ['0.10', '0.12']};\n\n// async\nwriteData('.travis.yml', data, function(err) {\n  // do stuff with \"err\"\n});\n\n// sync\nwriteData.sync('.travis.yml', data);\n```\n\nBoth would write a `.travis.yml` file to disk with the following contents:\n\n```yaml\nlanguage: node_js\nnode_js:\n  - \"0.10\"\n  - \"0.12\"\n```\n\n### JSON examples\n\n```js\nvar data = { name: 'foo', version: '0.1.0' };\n\n// async\nwriteData('package.json', data, function(err) {\n  // do stuff with \"err\"\n});\n\n// sync\nwriteData.sync('package.json', data);\n```\n\nBoth would write a `package.json` file to disk with the following contents:\n\n```json\n{ \n  \"name\": \"foo\", \n  \"version\": \"0.1.0\" \n}\n```\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\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</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\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</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [delete](https://www.npmjs.com/package/delete): Delete files and folders and any intermediate directories if they exist (sync and async). | [homepage](https://github.com/jonschlinkert/delete \"Delete files and folders and any intermediate directories if they exist (sync and async).\")\n* [read-data](https://www.npmjs.com/package/read-data): Read JSON or YAML files. | [homepage](https://github.com/jonschlinkert/read-data \"Read JSON or YAML files.\")\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-json](https://www.npmjs.com/package/write-json): Write a JSON file to disk, also creates intermediate directories in the destination path if… [more](https://github.com/jonschlinkert/write-json) | [homepage](https://github.com/jonschlinkert/write-json \"Write a JSON file to disk, also creates intermediate directories in the destination path if they don't already exist.\")\n* [write-yaml](https://www.npmjs.com/package/write-yaml): Write YAML. Converts JSON to YAML writes it to the specified file. | [homepage](https://github.com/jonschlinkert/write-yaml \"Write YAML. Converts JSON to YAML writes it to the specified file.\")\n* [write](https://www.npmjs.com/package/write): Write data to a file, replacing the file if it already exists and creating any… [more](https://github.com/jonschlinkert/write) | [homepage](https://github.com/jonschlinkert/write \"Write data to a file, replacing the file if it already exists and creating any intermediate directories if they don't already exist. Thin wrapper around node's native fs methods.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://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.6.0, on January 26, 2018._","maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-29T03:49:00.070Z","created":"2015-11-17T12:59:38.096Z","0.1.0":"2015-11-17T12:59:38.096Z","1.0.0":"2017-04-13T03:31:04.681Z","1.0.1":"2018-01-26T21:42:09.398Z","1.0.2":"2018-01-26T21:52:49.325Z"},"homepage":"https://github.com/jonschlinkert/write-data","keywords":["data","format","json","read","write","yaml"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/write-data.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/write-data/issues"},"license":"MIT","readmeFilename":"README.md","users":{"wdk":true}}