# write-yaml

> Write YAML. Converts JSON to YAML writes it to the specified file.

Latest version **1.0.0** (published 2017-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install write-yaml
pnpm add write-yaml
yarn add write-yaml
bun add write-yaml
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-04-13 |
| First published | 2014-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert, shinnn |
| Keywords | data, format, json, read, write, yaml |

## Links

- npm: https://www.npmjs.com/package/write-yaml
- Repository: https://github.com/jonschlinkert/write-yaml
- Issues: https://github.com/jonschlinkert/write-yaml/issues
- npm.io page: https://npm.io/package/write-yaml

## Dependencies (3)

- [write](https://npm.io/package/write.md) ^0.3.3
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.8.3
- [extend-shallow](https://npm.io/package/extend-shallow.md) ^2.0.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-04-13
- 0.2.2 — 2015-11-17
- 0.2.1 — 2015-06-18
- 0.2.0 — 2015-04-07
- 0.1.2 — 2014-11-06
- 0.1.1 — 2014-07-19
- 0.1.0 — 2014-07-19

## 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&label=Travis)](https://travis-ci.org/jonschlinkert/write-yaml)

> Write YAML. Converts JSON to YAML writes it to the specified file.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save write-yaml
```

Install with [yarn](https://yarnpkg.com):

```sh
$ yarn add write-yaml
```

## Usage

Add to your javascript/node.js application with the following line of code:

```js
var yaml = require('write-yaml');
```

### async

```js
var data = {language: 'node_js', node_js: ['0.10', '0.11']};

yaml('.travis.yml', data, function(err) {
  // do stuff with err
});
```

Would write `.travis.yml` to disk with the following contents:

```yaml
language: node_js
node_js:
  - "0.10"
  - "0.11"
```

### sync

```js
yaml.sync('.travis.yml', data);
```

Would write `.travis.yml` to disk with the following contents:

```yaml
language: node_js
node_js:
  - "0.10"
  - "0.11"
```

## About

### Related projects

* [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.")
* [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.")
* [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.")
* [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.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributors

| **Commits** | **Contributor** | 
| --- | --- |
| 12 | [jonschlinkert](https://github.com/jonschlinkert) |
| 2 | [shinnn](https://github.com/shinnn) |

### Building docs

_(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.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running 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:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 12, 2017._

---
_Source: https://npm.io/package/write-yaml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
