Broca
Lightweight (~450 bytes unminified) CSON frontmatter parser.
npm install broca
Usage
(pretending that Javascript has multiline strings)
var broca = ;var str = `---a: 1b: 'hello'c: [1, 2, 3]--- hello world`; ; //⇒ {a: 1, b:'hello', c:[1,2,3], body:'hello world'}
API
broca :: String → ∀ r. { body :: String | r }
Takes a string, returns an object containing at least a body
, and whatever properties it parses from the frontmatter.
Licence
MIT. © 2014 Matt Brennan.