JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19680
  • Score
    100M100P100Q150056F
  • License MIT

Front-matter parser.

Package Exports

  • hexo-front-matter
  • hexo-front-matter/dist/front_matter.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hexo-front-matter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hexo-front-matter

Build Status NPM version Coverage Status

Front-matter parser.

What is Front-matter?

Front-matter allows you to specify data at the top of a file. Here are two formats:

YAML front-matter

---
layout: false
title: "Hello world"
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

JSON front-matter

;;;
"layout": false,
"title": "Hello world"
;;;
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Prefixing separators are optional.

API

parse(str, [options])

Parses front-matter.

stringify(obj, [options])

Converts an object to a front-matter string.

Option Description Default
mode The mode can be either json or yaml. yaml
separator Separator ---
prefixSeparator Add prefixing separator. false

split(str)

Splits a YAML front-matter string.

escape(str)

Converts hard tabs to soft tabs.

License

MIT