gray-matter is a JavaScript library for parsing front matter from strings or files. It is commonly used in static site generators, documentation systems, content pipelines, and Markdown-based publishing tools. The library parses YAML front matter by default, but it can also work with JSON, TOML, CoffeeScript-style front matter, and custom parsers. It returns the content body and extracted metadata as a structured object that applications can process easily. Its parser is designed to be faster and more reliable than simple regular-expression approaches, especially around edge cases. It is useful whenever developers need clean metadata extraction from Markdown, HTML, or other text-based content files.

Features

  • YAML front matter parsing
  • JSON and TOML support
  • Custom delimiter handling
  • Structured metadata output
  • String and file input support
  • Node.js content pipeline fit

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow gray-matter

gray-matter Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of gray-matter!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Libraries

Registered

14 hours ago