Skip to content

About

RSS and Atom feeds for Yamb

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

yamb-render-xml

npm version Build status Coverage status Dependency status

Render Yamb post collections as RSS 2.0 and Atom 1.0 XML.

For GitHub Packages, route the @yamb scope to https://npm.pkg.github.com and install @yamb/render-xml.

Quick start

Requires Node.js 26.13 or later and yamb 1.1.0 or later. Direct rendering needs no storage.

pnpm add yamb yamb-render-xml
import { atom, rss } from 'yamb-render-xml';

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 news = rss({
  title: 'My blog',
  description: 'Latest articles',
  language: 'en',
  feed: 'https://example.com/blog/rss.xml'
});

const updates = atom({
  title: 'My blog',
  feed: 'https://example.com/blog/atom.xml',
  author: {
    name: 'Editor'
  }
});

const input = {
  posts: [source]
};

console.log(await news.collection(input, ctx));
console.log(await updates.collection(input, ctx));

Reference

Author

Alexey Simonenko

License

MIT. See LICENSE.

About

RSS and Atom feeds for Yamb

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages