{"_id":"write-data","_rev":"59473","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"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:19:24.000Z","created":"2015-11-17T12:59:38.096Z","1.0.2":"2018-01-26T21:52:49.325Z","1.0.1":"2018-01-26T21:42:09.398Z","1.0.0":"2017-04-13T03:31:04.681Z","0.1.0":"2015-11-17T12:59:38.096Z"},"users":{"wdk":true},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/write-data.git"},"versions":{"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":{"shasum":"88b2624bccb65492d4a8750a955428b589e53ae2","size":3603,"noattachment":false,"key":"/write-data/-/write-data-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-data/download/write-data-1.0.2.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-data-1.0.2.tgz_1517003568386_0.7619388774037361"},"directories":{},"publish_time":1517003569325,"_hasShrinkwrap":false,"_cnpm_publish_time":1517003569325},"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":{"shasum":"45eea9e163347d634dc6067e6bbe611159197b6a","size":3604,"noattachment":false,"key":"/write-data/-/write-data-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-data/download/write-data-1.0.1.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-data-1.0.1.tgz_1517002928436_0.5232996572740376"},"directories":{},"publish_time":1517002929398,"_hasShrinkwrap":false,"_cnpm_publish_time":1517002929398},"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","size":3363,"noattachment":false,"key":"/write-data/-/write-data-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-data/download/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":{},"publish_time":1492054264681,"_hasShrinkwrap":false,"_cnpm_publish_time":1492054264681},"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","size":3232,"noattachment":false,"key":"/write-data/-/write-data-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-data/download/write-data-0.1.0.tgz"},"directories":{},"publish_time":1447765178096,"_cnpm_publish_time":1447765178096,"_hasShrinkwrap":false}},"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._","_attachments":{},"homepage":"https://github.com/jonschlinkert/write-data","bugs":{"url":"https://github.com/jonschlinkert/write-data/issues"},"license":"MIT"}