import { MarkdownRepository, get } from "markdown-repository";
const posts = new MarkdownRepository("posts");
const all = get(posts);All Firestore comparison operators, applied to frontmatter fields.
==Equal!=Not equal<Less than<=Less than or equal>Greater than>=Greater than or equalarray-containsArray includes valuearray-contains-anyArray includes any of valuesinValue is one ofnot-inValue is none ofFunctional query builder with where, orderBy, limit — compose constraints naturally.
Both extensions supported by default. No configuration needed.
Nested folder structures with path-based slugs like discovery/worth-building.
Full type safety with custom validators. Generics flow through repository to query to get.
Point at a directory, start querying. Sensible defaults for extensions and behavior.
One dependency (gray-matter). Synchronous reads — perfect for static site generation.
interface MarkdownItem {
slug: string; // filename without extension
content: string; // markdown body after frontmatter
excerpt: string; // auto-extracted excerpt
[key: string]: any; // all frontmatter fields
}Create a MarkdownRepository with the path to your .md or .mdx files. Both extensions are supported by default.
Compose constraints with where(), orderBy(), and limit() — the same pattern as Firestore's modular SDK.
Call get() to read files, parse frontmatter, and return typed results. Get all items, one by slug, or query results.
markdown-repository brings Firestore's functional query pattern to local markdown files. Constraints are standalone functions that compose via query() and execute via get(). Filter by any frontmatter field using 10 operators: equality, comparison, array membership, and value membership.
Designed for Next.js, Astro, and any framework that reads content at build time. Synchronous reads work with generateStaticParams and getStaticProps. One dependency (gray-matter), TypeScript generics for type-safe frontmatter access, and recursive directory support for nested content structures.
Each tool works standalone, runs entirely in your browser, and requires no signup.
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.