Velite is a content framework that transforms Markdown/MDX, YAML, JSON, and other files into a type-safe data layer for applications. Version 0.3.1 (released February 2025) requires Node ^18.20.0 || >=20.3.0. It provides a CLI and API to define schemas using TypeScript/Zod, generating fully typed data for frontend usage. Compared to Contentlayer, Velite is actively maintained, offers a simpler setup, and supports more file types out of the box. It uses esbuild for fast builds and is designed for modern JavaScript/TypeScript projects.
npm install veliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define a collection of markdown posts with a Zod schema, build, and import typed data.
Use ESM syntax, set type:module in package.json, or use dynamic import().
Add .velite to .gitignore and ensure it's not committed.
Replace s.markdown() with s.mdx() in your config.
Run 'npx velite dev' or add '--watch' flag.
Wrap config object with defineConfig().
Run 'npx velite build' first. Then add 'paths': { '.velite/*': ['./.velite/*'] } to tsconfig.json compilerOptions.Change to import syntax, set type:module in package.json, or use .mjs extension.
Use 'import { s } from 'velite'' then s.object({...}).Check that posts directory exists relative to content root, and files have .md extension.