npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sphido/feed

v3.1.0

Published

RSS 2.0 feed generator for Sphido CMS

Readme

@sphido/feed

Generates valid RSS 2.0 feeds for Sphido CMS — as pure functions, no state to manage. The API matches @sphido/sitemap v4 (render… → write…).

Install

pnpm add @sphido/feed

Example

#!/usr/bin/env node

import { dirname, join, relative } from 'node:path';
import { allPages, getPages } from '@sphido/core';
import { frontmatter } from '@sphido/frontmatter'; // reads title, date, description, author …
import slugify from '@sindresorhus/slugify';
import { renderFeed, writeFeed } from '@sphido/feed';

const pages = await getPages({path: 'content'}, frontmatter, (page) => {
	page.slug = slugify(page.name) + '.html';
	page.url = join('/', relative('content', dirname(page.path)), page.slug);
});

const xml = renderFeed(
	{
		title: 'My Blog',
		link: 'https://example.com',
		description: 'Notes about everything',
		language: 'en',
		feedUrl: 'https://example.com/feed.xml',
	},
	[...allPages(pages)].map((page) => ({
		title: page.title ?? page.name,
		url: new URL(page.url, 'https://example.com'),
		date: new Date(page.date),
		description: page.description,
		author: page.author,
	})),
);

await writeFeed('public/feed.xml', xml);

API

renderFeed(channel, items)

Renders an RSS 2.0 feed to an XML string.

The channel requires title, link and description (a TypeError is thrown when any of them is missing); language is optional. When feedUrl is provided, an <atom:link rel="self"> element is emitted along with the xmlns:atom namespace — feed validators flag its absence.

items is any iterable (arrays and generators both work, so large sets need not be materialized). Each item requires title, url (string or URL) and date (a Date); description and author are optional. Items without a valid date are not skipped — a TypeError is thrown, because a feed with undated items is broken for every reader.

Details handled for you:

  • dates are formatted as RFC 822 (Date#toUTCString()), as RSS requires — not ISO
  • <lastBuildDate> is derived from the newest item date
  • <guid isPermaLink="true"> is set to the item URL
  • all text content is XML-escaped

writeFeed(file, xml)

Writes the XML to a file, creating parent directories when needed.

Source code

@sphido/feed