# jonschlinkert/gray-matter

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 also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert

Repository: https://github.com/jonschlinkert/gray-matter
Canonical: https://ross.abutalabs.com/products/gray-matter
Homepage: https://github.com/jonschlinkert
Language: JavaScript
License: MIT
License Family: permissive
Topics: yaml, front-matter, matter, javascript, parse, markdown, data, gatsby, assemble, phenomic, netlify, metalsmith, mapbox, config, frontmatter, front-matter-parsers, jonschlinkert, node, nodejs
Last push: 2025-06-14T20:27:39+00:00

## Health v2 (maintenance only)
Score: 44/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 26, release rhythm 35, longevity 100
- inputs: {"age_days": 4601, "days_push": 445, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4488, forks 168 (observed 2026-08-28T04:08:51.294842+00:00)

## What it is
gray-matter is a JavaScript library for parsing YAML front matter from strings or files, with support for JSON, TOML, and Coffee front matter and custom delimiters or engines. It is a battle-tested, widely adopted npm package used by tools like Gatsby, Astro, VitePress, and Metalsmith.

## Use cases
- parse yaml front matter from markdown files
- extract metadata from blog post markdown
- split front matter and content in nodejs
- parse toml front matter from a string
- build a static site generator that reads front matter
- extract title and slug from markdown documents

## When to choose
- you need reliable front matter parsing in a Node.js project
- you need support for multiple front matter formats like YAML, JSON, or TOML
- you want a fast, battle-tested parser used by major frameworks

## When to avoid
- you are not working in a JavaScript/Node.js environment
- you need to write or stringify front matter rather than parse it
- you need full markdown rendering, not just metadata extraction

## Facets
- artifact type: library
- maturity: stable
- function: parser, serialization, developer-tools
- domain: web-development, developer-tools, documentation, files
- platform: -
- tags: front-matter, yaml, markdown, toml, static-site-generators, metadata-extraction, nodejs, javascript

## Member repositories
- jonschlinkert/gray-matter (main) score 44

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:51.294842+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:29.520231+00:00, confidence not recorded.
  - readme: https://github.com/jonschlinkert/gray-matter (fetched 2026-08-28T04:08:51.294842+00:00, sha 0258be644079)
  - homepage: https://github.com/jonschlinkert (fetched 2026-08-29T09:06:54.157043+00:00, sha 9d92e13033bb)
  - registry_npm: https://registry.npmjs.org/gray-matter (fetched 2026-08-29T09:06:54.166092+00:00, sha d1bd6478cb75)
- Data as of 2026-08-30T08:39:29.467469+00:00.
