JSPM

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

Front matter parser that uses gray-matter and bits of real panther, so you know it's good. Kind of like consolidate.js engine, accept it's not an engine, it's a parser. Works with Assemble, express.js, parser-cache, or any application with similar conventions.

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 NPM version

Front matter parser that uses gray-matter and bits of real panther, so you know it's good. Kind of like consolidate.js engine, accept it's not an engine, it's a parser. Works with Assemble, express.js, parser-cache, or any application with similar conventions.

Install

Install with npm:

npm i parser-front-matter --save-dev

Usage

var parser = require('parser-front-matter');

API

.parseSync

  • str {String}: The string to parse.
  • options {Object}: to pass to gray-matter.

Parse the given str and return a file object.

.parse

  • str {String}: The string to parse.
  • options {Object|Function}: or next callback function.
  • next {Function}: callback function.

Parse the given str callback next(err, file).

.parseFileSync

  • filepath {String}
  • options {Object}: to pass to gray-matter
  • returns {Object}: Parsed file object.

Read a file at the given filepath, passing the resulting string and options to the .parse() method.

.parseFile

  • path {String}
  • options {Object|Function}: or next function.
  • next {Function}

Asynchronously read a file at the given filepath and callback next(err, str).

.parseFilesSync

  • filepath {String}
  • options {Object}: to pass to gray-matter
  • returns {Object}: Parsed file object.

Synchronously read and parse a glob of files from the given patterns, passing any options to globby and .parseSync().

.parseFiles

  • path {String}
  • options {Object|Function}: or next function.
  • next {Function}

Synchronously read and parse a glob of files from the given patterns and callback next(err, str). Options are passed to globby and .parseSync().

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on August 25, 2014.