{"name":"parser-front-matter","description":"Front matter parser that uses gray-matter and bits of real panther, so you know it's good.","version":"1.1.0","homepage":"https://github.com/jonschlinkert/parser-front-matter","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/parser-front-matter.git"},"bugs":{"url":"https://github.com/jonschlinkert/parser-front-matter/issues"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"doowb","email":"brian.woodward@gmail.com"}],"license":{"type":"MIT","url":"https://github.com/jonschlinkert/parser-front-matter/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","parsers":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*"},"dependencies":{"gray-matter":"^1.1.2","lodash":"^2.4.1"},"keywords":["assemble","cache","compile","consolidate","content","data","engine","express","front","front-matter","gray-matter","matter","noop","parse","parser","parsers","pass-through","process","templates","yaml"],"gitHead":"191fede1a1cbaabb52dd402f7724eebb497e34b8","_id":"parser-front-matter@1.1.0","_shasum":"3a6092b70a73e5e2441597d75868bd392828d668","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"3a6092b70a73e5e2441597d75868bd392828d668","tarball":"http://registry-npm.ywwl.com/parser-front-matter/download/parser-front-matter-1.1.0.tgz","integrity":"sha512-J6ZZe5pciH/FobjCxxxpyHWi5tKTeVC/QIAHcKhhz5npmD8ZuBqqvsWAvoRqN96HTZaIsW5XT+j63eY2LHM2/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaqPNcI8voovFAH4KI1E84LjDyBYH8aySA0uv7XhVKSQIgajbuLJ2Rgy6s4zEYCMrdZFGnH8xl5JNNL1wbQZrjoOE="}],"size":1843,"noattachment":false,"key":"/parser-front-matter/-/parser-front-matter-1.1.0.tgz"},"directories":{},"readme":"# parser-front-matter [![NPM version](https://img.shields.io/npm/v/parser-front-matter.svg?style=flat)](https://www.npmjs.com/package/parser-front-matter) [![NPM monthly downloads](https://img.shields.io/npm/dm/parser-front-matter.svg?style=flat)](https://npmjs.org/package/parser-front-matter) [![NPM total downloads](https://img.shields.io/npm/dt/parser-front-matter.svg?style=flat)](https://npmjs.org/package/parser-front-matter) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/parser-front-matter.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/parser-front-matter)\n\n> Front matter parsing middleware based on gray-matter.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save parser-front-matter\n```\n\nThis is similar to a consolidate.js engine, but for parsing. Works with [assemble](https://github.com/assemble/assemble), [verb](https://github.com/verbose/verb), [generate](https://github.com/generate/generate), [update](https://github.com/update/update), express.js, parser-cache, or any application with similar conventions.\n\n## Usage\n\n```js\nvar parser = require('parser-front-matter');\n```\n\n## API\n\n### [.parse](index.js#L36)\n\nParse front matter from the given string or the `contents` in the given `file` and callback `next(err, file)`.\n\nIf an object is passed, either `file.contents` or `file.content`\nmay be used (for gulp and assemble compatibility).\n\n**Params**\n\n* `file` **{String|Object}**: The object or string to parse.\n* `options` **{Object|Function}**: or `next` callback function. Options are passed to [gray-matter](https://github.com/jonschlinkert/gray-matter).\n* `next` **{Function}**: callback function.\n\n**Example**\n\n```js\n// pass a string\nparser.parse('---\\ntitle: foo\\n---\\nbar', function (err, file) {\n  //=> {content: 'bar', data: {title: 'foo'}}\n});\n\n// or an object\nvar file = {contents: new Buffer('---\\ntitle: foo\\nbar')};\nparser.parse(file, function(err, res) {\n  //=> {content: 'bar', data: {title: 'foo'}}\n});\n```\n\n### [.parseSync](index.js#L72)\n\nParse front matter from the given string or the `contents` in the given `file`. If an object is passed, either `file.contents` or `file.content` may be used (for gulp and assemble compatibility).\n\n**Params**\n\n* `file` **{String|Object}**: The object or string to parse.\n* `options` **{Object}**: passed to [gray-matter](https://github.com/jonschlinkert/gray-matter).\n\n**Example**\n\n```js\n// pass a string\nvar res = parser.parseSync('---\\ntitle: foo\\n---\\nbar');\n\n// or an object\nvar file = {contents: new Buffer('---\\ntitle: foo\\nbar')};\nvar res = parser.parseSync(file);\n//=> {content: 'bar', data: {title: 'foo'}}\n```\n\n## file object\n\nReturned `file` objects have the following properties (no other properties are modified on the given file):\n\n* `data`: data from parsed front matter\n* `content`: the content string, excluding front-matter (assemble compatibility)\n* `contents`: the content string as a buffer, excluding front-matter\n* `orig`: the original content string with front-matter included\n\n## About\n\n### Related projects\n\n* [gray-matter](https://www.npmjs.com/package/gray-matter): Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML… [more](https://github.com/jonschlinkert/gray-matter) | [homepage](https://github.com/jonschlinkert/gray-matter \"Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML front matter by default, but also has support for YAML, JSON, TOML or Coffee Front-Matter, with options to set custom delimiters. Used by metalsmith, assemble, verb and \")\n* [parser-cache](https://www.npmjs.com/package/parser-cache): Cache and load parsers, similiar to consolidate.js engines. | [homepage](https://github.com/jonschlinkert/parser-cache \"Cache and load parsers, similiar to consolidate.js engines.\")\n* [parser-csv](https://www.npmjs.com/package/parser-csv): CSV parser, compatible with [parser-cache](https://github.com/jonschlinkert/parser-cache). | [homepage](https://github.com/jonschlinkert/parser-csv \"CSV parser, compatible with [parser-cache].\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 69 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [doowb](https://github.com/doowb) |\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 16, 2017._","publish_time":1423861446466,"_cnpm_publish_time":1423861446466,"dist-tags":{"latest":"1.6.4"}}