# meta-marked

> The 'marked' markdown processor with a simple metadata system.

Latest version **0.5.0** (published 2020-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install meta-marked
pnpm add meta-marked
yarn add meta-marked
bun add meta-marked
```

## 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.5.0 |
| Published | 2020-11-19 |
| First published | 2013-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 54 |
| Author | j201 |
| Maintainers | j201 |
| Keywords | markdown, metadata, html |

## Links

- npm: https://www.npmjs.com/package/meta-marked
- Repository: https://github.com/j201/meta-marked
- Homepage: https://github.com/j201/meta-marked#readme
- Issues: https://github.com/j201/meta-marked/issues
- npm.io page: https://npm.io/package/meta-marked

## Dependencies (2)

- [marked](https://npm.io/package/marked.md) ~0.8.2
- [js-yaml](https://npm.io/package/js-yaml.md) ~3.14.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2020-11-19
- 0.4.4 — 2020-11-19
- 0.4.3 — 2020-11-19
- 0.4.2 — 2016-08-25
- 0.4.1 — 2016-03-22
- 0.4.0 — 2015-11-25
- 0.3.4 — 2015-09-16
- 0.3.3 — 2014-10-16
- 0.3.2 — 2014-09-22
- 0.3.1 — 2014-02-20
- 0.3.0 — 2014-02-14
- 0.2.1 — 2014-01-08
- 0.2.0 — 2013-12-18
- 0.1.0 — 2013-09-15
- 0.0.0 — 2013-09-12

## README

## meta-marked
#### The [marked](http://github.com/chjj/marked) markdown processor for Node.js with support for [YAML](http://yaml.org/) metadata

[![Dependency Status](https://david-dm.org/j201/meta-marked.svg)](https://david-dm.org/j201/meta-marked)

Just a quick extension I needed for processing markdown in Node. Props to Christopher Jeffrey for his excellent markdown processor 'marked'.

The `meta-marked` function behaves exactly the same as [`marked`](http://github.com/chjj/marked#usage), except for the following:

- Instead of returning a parsed string, `meta-marked` returns an object with the following properties:
	- `meta` contains the metadata object or `null` if metadata isn't found
	- `html` contains the parsed HTML
	- `markdown` contains the text of the markdown section of the string
- `metaMarked.noMeta` is a reference to the `marked` function, so it can be used to avoid parsing metadata.

In order to include metadata in a document, insert YAML at the top of the document surrounded by `---` and `...`. Note that if the given string doesn't start with `---`, it will not be interpreted as having metadata.

### Example

```
---
Title:   My awesome markdown file
Author:  Me
Scripts:
    - js/doStuff.js
    - js/doMoreStuff.js
...

##Header
Regular text and stuff goes here.
```

You can also use the approach below, which will result in a very nice data table at the top of your markdown when viewing the file GitHub:

```
---
Title:   My awesome markdown file
Author:  Me
Scripts:
    - js/doStuff.js
    - js/doMoreStuff.js
---

##Header
Regular text and stuff goes here.
```

Both of the above will result in the following output:

```
{
	"meta": {
		"Title": "My awesome markdown file",
		"Author": "Me",
		"Scripts": [
			"js/doStuff.js",
			"js/doMoreStuff.js"
		]
	},
	"html": "<h2>Header</h2>\n<p>Regular text and stuff goes here.</p>\n",
	"markdown": "\n\n##Header\nRegular text and stuff goes here."
}
```

###Testing

```
npm test
```

---

Licensed under [the MIT License](http://opensource.org/licenses/MIT). © 2013-2014 j201

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