Package Exports
- parser-front-matter
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 (parser-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
parser-front-matter

Front matter parser that uses gray-matter and bits of real panther, so you know it's good.
This is kind of like a consolidate.js engine, accept it's not an engine, it's a parser. Works with Assemble, verb, express.js, parser-cache, or any application with similar conventions.
Install with npm
npm i parser-front-matter --save
Usage
var parser = require('parser-front-matter');
Related
- gray-matter: Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML front matter by default, but also has support for YAML, JSON, TOML or Coffee Front-Matter, with options to set custom delimiters.
- template: Render templates from any engine. Make custom template types, use layouts on pages, partials or any custom template type, custom delimiters, helpers, middleware, routes, loaders, and lots more. Powers Assemble v0.6.0, Verb v0.3.0 and your application.
- parser-cache: Cache and load parsers, similiar to consolidate.js engines.
- parsers: Like consolidate.js, but for parsers instead of engines.
- parser-csv: CSV parser, compatible with [parser-cache].
API
.parse
Parse the given file
into a normalized file
object and callback next(err, file)
. Options are passed to gray-matter, and if options
has a locals
property, it will be merged with the data
property on the normalized file
object.
file
{String|Object}: The object or string to parse.options
{Object|Function}: ornext
callback function.next
{Function}: callback function.
Normalized file
objects should have the following properties:
path
The source file path, if provideddata
: metadata, from yaml front matter and/or localscontent
: the content of a file, excluding front-matterorig
: the original content of a file, including front-matter
.parseSync
file
{String|Object}: The object or string to parse.options
{Object}: to pass to gray-matter.
Parse the given file
and return a normalized file
object,
with data
, content
, path
and orig
properties.
Author
Jon Schlinkert
License
Copyright (c) 2014-2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on April 05, 2015.