@yuheiy/html-frontmatter
v0.0.1
Published
Parse front-matter from raw HTML.
Downloads
4
Readme
html-frontmatter
Parse front-matter from raw HTML.
Installation
npm install @yuheiy/html-frontmatter
Usage
const parseFrontMatter = require('@yuheiy/html-frontmatter')
const frontMatter = parseFrontMatter(`<!--
title: Awesome article
authors:
- sato
- suzuki
- takahashi
-->
<p>hello</p>
`)
console.log(frontMatter)
/*
{
data: {
title: 'Awesome article',
authors: [
'sato',
'suzuki',
'takahashi'
]
},
content: '<p>hello</p>\n'
}
*/
License
MIT