# read-yaml

> Very thin wrapper around js-yaml for directly reading in YAML files.

Latest version **1.1.0** (published 2017-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-yaml
pnpm add read-yaml
yarn add read-yaml
bun add read-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.1.0 |
| Published | 2017-04-02 |
| First published | 2014-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert, shinnn |
| Keywords | async, data, file, fs, parse, read, sync, yaml, yml |

## Links

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

## Dependencies (2)

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

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-04-02
- 1.0.0 — 2014-12-07
- 0.3.1 — 2014-12-05
- 0.3.0 — 2014-12-05
- 0.2.0 — 2014-07-19
- 0.1.0 — 2014-06-11

## README

# read-yaml [![NPM version](https://img.shields.io/npm/v/read-yaml.svg?style=flat)](https://www.npmjs.com/package/read-yaml) [![NPM monthly downloads](https://img.shields.io/npm/dm/read-yaml.svg?style=flat)](https://npmjs.org/package/read-yaml)  [![NPM total downloads](https://img.shields.io/npm/dt/read-yaml.svg?style=flat)](https://npmjs.org/package/read-yaml) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/read-yaml.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/read-yaml)

> Very thin wrapper around js-yaml for directly reading in YAML files.

## Install

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

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

## API

### [readYaml](index.js#L29)

Read yaml file asynchronously and parse content as JSON.

**Params**

* `filepath` **{String}**: Path of the file to read.
* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml)
* `cb` **{Function}**: Callback function `

**Example**

```js
var readYaml = require('read-yaml');
readYaml('config.yml', function(err, data) {
  if (err) throw err;
  console.log(data);
});
```

### [.sync](index.js#L69)

Read yaml file synchronously and parse content as JSON.

**Params**

* `filepath` **{String}**: Path of the file to read.
* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml).
* `returns` **{Object}**: JSON

**Example**

```js
var read = require('read-yaml');
var config = read.sync('config.yml');
```

## About

### Related projects

* [copy](https://www.npmjs.com/package/copy): Copy files or directories using globs. | [homepage](https://github.com/jonschlinkert/copy "Copy files or directories using globs.")
* [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.")
* [write](https://www.npmjs.com/package/write): Write files to disk, creating intermediate directories if they don't exist. | [homepage](https://github.com/jonschlinkert/write "Write files to disk, creating intermediate directories if they don't exist.")

### Contributing

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

### Contributors

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

### 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.4.3, on April 02, 2017._

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