Skip to content

arc-source-coder/bun-matter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bun-matter

A fast, zero-dependency frontmatter parser built with Bun's native APIs. Supports YAML, TOML, and JSON frontmatter. bun-matter is a drop-in replacement for gray-matter.

Inspired by and based on gray-matter by Jon Schlinkert.

Benchmarks

Coming soon

Installation

bun add bun-matter

Usage

bun-matter exposes the same public API as gray-matter, making it easy to switch.

import matter from 'bun-matter';

const file = `
---
title: Hello World
date: 2025-12-22
---
# Content
`;

const parsed = matter(file);
console.log(parsed.data);    // { title: 'Hello World', date: '2025-12-22' }
console.log(parsed.content); // "# Content"

Limitations

bun-matter intentionally does not support:

  • CSON front-matter
  • Coffeescript front-matter
  • JavaScript front-matter parsing

If you need these formats, consider using gray-matter.

Development

To install dependencies:

bun install

To run:

bun run src/index.ts

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published