Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can als...
Gray-matter is a versatile NPM package designed to parse front-matter from a string or file. It offers fast, reliable, and easy-to-use capabilities for extracting metadata in formats such as YAML, JSON, TOML, or Coffee Front-Matter. This package, created by Jon Schlinkert, is widely used in projects like metalsmith, assemble, verb, and many others.
To install Gray-matter using npm, use the following command:
npm install gray-matter
Please refer to the changelog for any breaking changes that may have been introduced in version 3.0.
Gray-matter is a powerful tool for extracting front-matter from strings or files with support for various formats and custom delimiters. Its speed, reliability, and flexibility make it a preferred choice for parsing metadata in projects requiring accurate and efficient handling of front-matter. With ongoing support and maintenance from the community and the author, Jon Schlinkert, Gray-matter continues to be a valuable asset for developers.