# json-to-pretty-yaml

> A node module to convert JSON to YAML

Latest version **1.2.2** (published 2018-04-30) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install json-to-pretty-yaml
pnpm add json-to-pretty-yaml
yarn add json-to-pretty-yaml
bun add json-to-pretty-yaml
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2018-04-30 |
| First published | 2018-04-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | separate (@types/json-to-pretty-yaml) |
| Module format | CommonJS |
| Node | >= 0.2.0 |
| Dependencies | 2 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Maintainers | alexcrist |
| Keywords | yml, yaml, json, cli, util |

## Links

- npm: https://www.npmjs.com/package/json-to-pretty-yaml
- Repository: https://github.com/alexcrist/json-to-pretty-yaml
- Homepage: https://github.com/alexcrist/json-to-pretty-yaml#readme
- Issues: https://github.com/alexcrist/json-to-pretty-yaml/issues
- npm.io page: https://npm.io/package/json-to-pretty-yaml

## Dependencies (2)

- [remedial](https://npm.io/package/remedial.md) ^1.0.7
- [remove-trailing-spaces](https://npm.io/package/remove-trailing-spaces.md) ^1.0.6

## 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.2.2 (latest) — 2018-04-30
- 1.2.1 — 2018-04-27
- 1.2.0 — 2018-04-27
- 1.1.0 — 2018-04-26

## README

# ♻️ json-to-pretty-yaml

> A node module to convert JSON to pretty YAML

## Installation

`npm install --save json-to-pretty-yaml`

## Usage

#### `index.js`

```javascript
const fs = require('fs');
const YAML = require('json-to-pretty-yaml');
const json = require('input.json');

const data = YAML.stringify(json);
fs.writeFile('output.yaml', data);
```

#### `input.json`

```json
{
  "a": 1,
  "b": 2,
  "c": [
    {
      "d": "cool",
      "e": "new"
    },
    {
      "f": "free",
      "g": "soon"
    }
  ]
}
```

#### `output.yaml`

```yaml
a: 1
b: 2
c:
  - d: "cool"
    e: "new"
  - f: "free"
    g: "soon"
```

## Testing

`npm test`

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