Markdown Repository

Query .md and .mdx files by frontmatter with a Firestore-style API. Works with Next.js App Router and server components.

How To Use

npm versionLicense
$ npm install markdown-repository
import { MarkdownRepository, get } from "markdown-repository";

const repo = new MarkdownRepository("./content");
const posts = get(repo);
npmGitHubDocs

How It Works

1

Point at a directory

Create a MarkdownRepository with the path to your .md or .mdx files. Both extensions are supported by default.

2

Build a query

Compose constraints with where(), orderBy(), and limit() — the same pattern as Firestore's modular SDK.

3

Execute with get()

Call get() to read files, parse frontmatter, and return typed results. Get all items, one by slug, or query results.

FAQ

Built & Maintained by Varstatt

Varstatt is a one-person product studio run by Jurij Tokarski, product engineer since 2011. These tools are free and open — no signup, no catch.