{"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":"http://registry-npm.ywwl.com/write-data/download/write-data-1.0.0.tgz","integrity":"sha512-8KQg2kxcCW3CEFfOoVpWS8vv1HfIs2Z3NsrHXBsxtwJ8o+g15pUBhr/z/aziAvLsjjiydNELYfKSaxp2c5aE0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDb4ko+gW9rrXIbIArGSV+XgONCKTyjacqmje463BNetAiBko7qpAeX3VMrhPkAjui7X/xCk/QVAR6TBK/jSk2z27w=="}],"size":3363,"noattachment":false,"key":"/write-data/-/write-data-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/write-data-1.0.0.tgz_1492054264134_0.42220807587727904"},"directories":{},"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._","publish_time":1492054264681,"_cnpm_publish_time":1492054264681,"dist-tags":{"latest":"1.0.2"}}