0.0.1 • Published 3 years ago

markdown-headers v0.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

Markdown Headers

Parse markdown document's yaml headers.

npm version

install

npm install markdown-headers

Usage

full example

const {parseMarkdownHeaders} = require('markdown-headers');

// test example
const document = `
---
title: 'this is a title'
description: 'this is a description'
tags:
    - hello world
    - markdown parse
votes: 10000
show_cover: true
---

This is markdown content.

# title

## subtitle

- [ ] check

`
// usage
const result = parseMarkdownHeaders(document);

output

{
  headers: {
    title: 'this is a title',
    description: 'this is a description',
    tags: [ 'hello world', 'markdown parse' ],
    votes: 10000,
    show_cover: true
  },
  markdown: 'This is markdown content.\n\n# title\n\n## subtitle\n\n- [ ] check'
}
0.0.1

3 years ago

0.0.1-alpha3

3 years ago

0.0.1-alpha2

3 years ago

0.0.1-alpha

3 years ago