{%= name %} {%= badge("fury") %}
Used by assemble, verb, and thousands of other projects!
v0.5.0 has breaking changes!
YAML is now parsed using the
.safeLoad()
method from js-yaml.To parse coffee, CSON or javascript front matter, you must set
options.eval
to true.stringify()
has been renamed totoJSON()
stringifyYAML()
has been renamed totoYAML()
Highlights
Reliable and battle-tested.
Will extract and parse:
CoffeeScript when
options.eval
is set totrue
CSON when
options.eval
is set totrue
JavaScript: when
options.eval
is set totrue
Easy to add additional parsers! pull requests welcome!
TOC
Install
Usage
var matter = require('gray-matter');
console.log(matter('---\ntitle: foo\n---\nbar');
//=> {data: {title: 'foo'}, content: 'bar', orig: '---\ntitle: foo\n---\nbar'}
API
Options
Examples
Why?
Authors
License
Last updated
Was this helpful?