1.0.1 • Published 8 years ago

md-vars v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Utility to parse variables at the top of a markdown file.

Installation

Npm

npm install md-vars

Example

import parse from 'md-vars'

const markdown = `
---
title: "Hello"
"subtitle": "World",
  spaces: 1
---

* A
* B
* C
`

// Will extract the variables from the top of the file as JSONish.
parse(markdown) /*
{
  title: 'Hello',
  subtitle: 'World',
  spaces: 1,
  text: '* A\n* B\n* C'
}
*/

Contributions

  • Use npm test to run tests.

Please feel free to create a PR!