Export Yamb posts and collections as source JSON views or JSON Feed 1.1 objects.
For GitHub Packages, route the @yamb scope to https://npm.pkg.github.com and install @yamb/render-json.
Requires Node.js 26.13 or later and yamb 1.1.0 or later. Direct rendering needs no storage.
pnpm add yamb yamb-render-jsonimport { feed, json } from 'yamb-render-json';
const source = {
id: 'hello',
uri: '2026/11/hello',
title: 'Hello',
text: '**Hello**, world.',
status: 'published',
publishedAt: '2026-11-12T09:00:00Z',
updatedAt: '2026-11-12T09:00:00Z'
};
const ctx = {
base: new URL('https://example.com/blog'),
timeZone: 'UTC'
};
const renderer = json();
const post = await renderer.post(source, ctx);
const collection = await renderer.collection(
{
posts: [source],
view: 'full'
},
ctx
);
console.log(
JSON.stringify({
post,
collection
})
);
const news = feed({
title: 'My blog',
feed: 'https://example.com/blog/feed.json'
});
const result = await news.collection(
{
posts: [source]
},
ctx
);
console.log(JSON.stringify(result));- Source views and related-post settings
- JSON Feed configuration and content
- Yamb core reference for renderer registration and context
MIT. See LICENSE.