Yamb manages editable posts and lazy collections for websites, scripts and jobs. The application supplies storage and can add content preparation and renderers.
Requires Node.js 26.13 or later. Install core and file storage.
pnpm add @yamb/core @yamb/storage-filesUse a trusted directory for ./posts.
import { yamb } from '@yamb/core';
import { files } from '@yamb/storage-files';
await using blog = yamb({
storage: files({
path: './posts'
}),
base: 'https://example.com/blog',
timeZone: 'UTC'
});
await blog.open();
const post = await blog.create({
title: 'Hello',
text: 'A first draft.'
});
post.title = 'Hello, Yamb';
post.text = '**Hello**, world.';
post.tags.push('javascript');
await post.save();
await post.publish();
for await (const article of blog.published.tagged('javascript').recent(10)) {
console.log(article.title, article.url().href);
}| Package | Role |
|---|---|
| storage-files | Markdown files with JSON frontmatter in a local directory |
| storage-mongo | MongoDB with prepared collections and indexes |
| storage-sqlite | Node's built-in SQLite with a prepared database |
| markdown | Source → editable tokens → HTML → sanitized page/feed projections |
| microtypo | Native MicroTypo adapter between HTML conversion and cleanup |
| render-html | HTML view objects for individual posts |
| render-json | Post/collection JSON views and JSON Feed 1.1 |
| render-xml | RSS 2.0 and Atom 1.0 feeds |
- Configuration, posts, cover and collections and queries
- Storage and renderer extension APIs
- Content preparation
- Exports and errors
- Architecture
MIT. See LICENSE.