broca

0.1.1 • Public • Published

Broca Build Status

Lightweight (~450 bytes unminified) CSON frontmatter parser.

npm install broca

Broca's area

Usage

(pretending that Javascript has multiline strings)

var broca = require('broca');
var str = `
---
a: 1
b: 'hello'
c: [1, 2, 3]
---
 
hello world
`;
 
broca(str); //⇒ {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.

Package Sidebar

Install

npm i broca

Weekly Downloads

4

Version

0.1.1

License

MIT

Last publish

Collaborators

  • quarterto