{"id":14985699,"url":"https://github.com/jonschlinkert/write-yaml","last_synced_at":"2025-04-11T22:04:59.201Z","repository":{"id":18786673,"uuid":"22000213","full_name":"jonschlinkert/write-yaml","owner":"jonschlinkert","description":"Basic node.js utility for converting JSON to YAML and writing formatting YAML files to disk.","archived":false,"fork":false,"pushed_at":"2019-11-18T19:48:37.000Z","size":21,"stargazers_count":41,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-20T02:48:53.460Z","etag":null,"topics":["data","disk","file","file-system","fs","write","yaml"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-19T02:34:02.000Z","updated_at":"2023-10-20T09:28:15.000Z","dependencies_parsed_at":"2022-09-12T19:30:21.058Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/write-yaml","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fwrite-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fwrite-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fwrite-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fwrite-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/write-yaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239785315,"owners_count":19696754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","disk","file","file-system","fs","write","yaml"],"created_at":"2024-09-24T14:11:30.407Z","updated_at":"2025-02-20T05:32:11.365Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","readme":"# write-yaml [![NPM version](https://img.shields.io/npm/v/write-yaml.svg?style=flat)](https://www.npmjs.com/package/write-yaml) [![NPM monthly downloads](https://img.shields.io/npm/dm/write-yaml.svg?style=flat)](https://npmjs.org/package/write-yaml) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/write-yaml.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/write-yaml)\n\n\u003e Write YAML. Converts JSON to YAML writes it to the specified file.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save write-yaml\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add write-yaml\n```\n\n## Usage\n\nAdd to your javascript/node.js application with the following line of code:\n\n```js\nvar yaml = require('write-yaml');\n```\n\n### async\n\n```js\nvar data = {language: 'node_js', node_js: ['0.10', '0.11']};\n\nyaml('.travis.yml', data, function(err) {\n  // do stuff with err\n});\n```\n\nWould write `.travis.yml` to disk with the following contents:\n\n```yaml\nlanguage: node_js\nnode_js:\n  - \"0.10\"\n  - \"0.11\"\n```\n\n### sync\n\n```js\nyaml.sync('.travis.yml', data);\n```\n\nWould write `.travis.yml` to disk with the following contents:\n\n```yaml\nlanguage: node_js\nnode_js:\n  - \"0.10\"\n  - \"0.11\"\n```\n\n## About\n\n### Related projects\n\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-data](https://www.npmjs.com/package/write-data): Write a YAML or JSON file to disk. Automatically detects the format to write based… [more](https://github.com/jonschlinkert/write-data) | [homepage](https://github.com/jonschlinkert/write-data \"Write a YAML or JSON file to disk. Automatically detects the format to write based on extension. Or pass `ext` on the options.\")\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\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| 12 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [shinnn](https://github.com/shinnn) |\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 \u0026\u0026 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 \u0026\u0026 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](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.5.0, on April 12, 2017._","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fwrite-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fwrite-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fwrite-yaml/lists"}