0.1.1 • Published 10 years ago

broca v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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.