@yuheiy/html-frontmatter

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @yuheiy/html-frontmatter

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

2.95 kB

Total Files

4

Last publish

Collaborators

  • yuheiy