# remark-parse-yaml

> Parses yaml blocks into structured data

Latest version **0.0.3** (published 2019-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install remark-parse-yaml
pnpm add remark-parse-yaml
yarn add remark-parse-yaml
bun add remark-parse-yaml
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-07-28 |
| First published | 2017-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mark Hudnall |
| Maintainers | landakram |
| Keywords | remark, remark-plugin, markdown, gfm |

## Links

- npm: https://www.npmjs.com/package/remark-parse-yaml
- Repository: https://github.com/landakram/remark-parse-yaml
- Homepage: https://github.com/landakram/remark-parse-yaml#readme
- Issues: https://github.com/landakram/remark-parse-yaml/issues
- npm.io page: https://npm.io/package/remark-parse-yaml

## Dependencies (2)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1
- [unist-util-map](https://npm.io/package/unist-util-map.md) ^1.0.3

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2019-07-28
- 0.0.2 — 2018-12-27
- 0.0.1 — 2017-12-24

## README

# remark-parse-yaml
[![npm version](https://badge.fury.io/js/remark-parse-yaml.svg)](https://badge.fury.io/js/remark-parse-yaml) [![Build Status](https://travis-ci.org/landakram/remark-parse-yaml.svg?branch=master)](https://travis-ci.org/landakram/remark-parse-yaml)

This [remark](https://github.com/wooorm/remark) plugin takes markdown with yaml frontmatter and parses the yaml into an object.

## Usage

```javascript
const unified = require('unified')
const markdown = require('remark-parse')
const frontmatter = require('remark-frontmatter')
const parseFrontmatter = require('remark-parse-yaml');

let processor = unified()
    .use(markdown)
    .use(frontmatter)
    .use(parseFrontmatter)
```

When the processor is run, `yaml` nodes will now have an additional key, `parsedValue`, 
attached to its `data` key.

Say that we have this markdown string:

``` markdown
---
metadata: this is metadata
tags:
    - one
    - two
---

# Heading 
```

When parsed, this will produce a `yaml` node with a `data` object that looks like this:

```javascript
data: {
    parsedValue: {
        metadata: "this is metadata",
        tags: ["one", "two"]
    }
}
```

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