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

metalsmith-rssfeed

v0.0.6

Published

A metalsmith plugin to create RSS feeds from files

Readme

metalsmith-rssfeed

Build Status npm version

Yet another metalsmith plugin to generate an RSS feeds.

Compatible with (but does not depend on):

Installation

$ npm install metalsmith-rssfeed --save

Usage

var rssfeed     = require('metalsmith-rssfeed');

// create a rss feed from the first 20 elements of the collection posts
// and save it as feed.xml
metalsmith.use(reefeed({
    collection: "posts",
    limit: 20,
    name: "feed.xml",
});

Examples

create a rss feed for containing every post with a specific tag and save it in one file per tag:

metalsmith.use(reefeed({
    collectionKey: "tags",
    name: ":collection.xml",
});

create a rss feed for containing every post with a specific tag and save it in one file per tag:

metalsmith.use(reefeed({
    collectionKey: "tags",
    name: ":collection.xml",
});

merge all tagged posts in a single feed alltags.xml:

metalsmith.use(reefeed({
    title: 'Tagged Posts'
    description: 'All tagged posts are in this feed.'
    collectionKey: "tags",
    name: "alltags.xml",
});

Options and default values

{
    // filename of the rss feed. 
    // options.replaceToken will be replaced by the feed name when 
    // generating multiple feeds e.g. one for each tag.
    name: ':collection.xml',

    // ** feed options **
    // if not set explicitely will try to read these from metalsmith 
    // metadata like:
    // metadata[key] or metadata.site[key]

    // author of rss feed.    
    author: '',
    // title of rss feed.
    // options.replaceToken will be replaced by the feed name when 
    // generating multiple feeds e.g. one for each tag.
    title:  '',
    // description of rss feed.
    // options.replaceToken will be replaced by the feed name when 
    // generating multiple feeds e.g. one for each tag.
    description: '',
    // url of the site
    siteUrl: '',
    // generator of the rss feed.
    generator: 'metalsmith-rssfeed',
    // a custom function returning the feed options above.
    // other options will be ignored if this is set.
    feedOptions: (CollectionName, collection, options) => ({
            generator: options.generator,
            site_url: options.siteUrl,
            author: options.author.name || options.author,
            description: options.description.replace(o.replaceToken, c),
            title: options.title.replace(o.replaceToken, c),
            feed_url: options.pathToUrl(feedName)
    }),

    // ** feed items **

    // generate feed for a specific collection.
    // if it is an array will generate a feed for each item. 
    // if false generate for all colletions in options.collectionKey
    collection: false,
    // key to use to look for collections. 
    // defaults to 'collections' if options.collection was set. 
    collectionKey: o.collection ? 'collections' : false,
    // token to be replaced by collection name.
    replaceToken: ':collection',
    // pattern to filter files if neither collection nor
    // collection key were specified.
    pattern: '**';
    // key to permalink of file
    permalinkKey: 'permalink';
    // max number of items in the feed
    // if false all files are included.
    o.limit: false;
    // function to generate absolute url from file path
    pathToUrl: p => url.resolve(options.siteUrl, p);
    // a custom function to return the feed items
    // defaults will be ignored if this is set.
    itemOptions:  (file, options) => ({
            title: file.title,
            description: file.less || file.excerpt || file.contents,
            author: file.author.name || file.author,
            url: options.pathToUrl(file[options.permalinkKey] || file.path, options),
            date: file.date,            
            guid: file[options.permalinkKey] ? null : file.path
    })

Notes

metalsmith-feed is another great feed creation plugin, however it strictly depends on collections.