{"library":"parser-front-matter","title":"parser-front-matter","description":"Front matter parsing middleware based on gray-matter, providing a callback-oriented API for parsing YAML-like front matter from strings or file objects. Version 1.6.4 is the latest stable release, with no major updates since 2019. It supports both async (parse) and sync (parseSync) methods, and is designed for use with build tools like assemble, verb, or generate. Unlike direct gray-matter usage, this package integrates via middleware conventions, but it is slow, unmaintained, and lacks TypeScript definitions.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install parser-front-matter"],"cli":null},"imports":["import parser from 'parser-front-matter'","import { parse } from 'parser-front-matter'","import { parseSync } from 'parser-front-matter'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import parser from 'parser-front-matter';\n\n// Parse a string with front matter\nparser.parse('---\\ntitle: Hello\\n---\\nWorld', (err, file) => {\n  if (err) console.error(err);\n  console.log(file.data.title); // 'Hello'\n  console.log(file.content);     // 'World'\n});\n\n// Parse an object (e.g., from gulp)\nconst fileObj = { contents: Buffer.from('---\\nfoo: bar\\n---\\nbaz') };\nparser.parse(fileObj, (err, file) => {\n  if (err) console.error(err);\n  console.log(file.data.foo); // 'bar'\n  console.log(file.content);  // 'baz'\n});\n\n// Synchronous usage\nconst result = parser.parseSync('---\\ntitle: Sync\\n---\\nContent');\nconsole.log(result.data.title); // 'Sync'","lang":"typescript","description":"Shows async and sync front matter parsing from string and object, with error handling.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}