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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bliztek/feed-generator

v1.0.4

Published

A simple and lightweight Node.js library for generating RSS 2.0, Atom, and JSON Feed formats.

Readme

Feed Generator: RSS, Atom, JSON

Build Status Codecov npm License Downloads Bundle Size

A simple and lightweight Node.js library for generating RSS 2.0, Atom, and JSON Feed formats. Perfect for syndicating content in blogs, news sites, or any platform that needs standardized feed formats.


Features

  • Generate valid RSS 2.0, Atom, and JSON Feed outputs.
  • Easy-to-use API for creating feeds.
  • Developed using TypeScript / type-safe.
  • Tests & snapshots for each syndication format to avoid regressions.
  • Fully customizable feed metadata and entries.
  • Outputs that pass online validation (e.g., W3C Feed Validator, JSON Feed Validator).
  • No external dependencies.

Installation

Install the package via npm:

npm install @bliztek/feed-generator

Or using Yarn:

yarn add @bliztek/feed-generator

Usage

1. Import the Feed Generators

import {
  generateRSSFeed,
  generateAtomFeed,
  generateJSONFeed,
} from "@bliztek/feed-generator";

2. Define Your Feed Data

Each feed type (RSS, Atom, and JSON) uses a specific data structure. Below is an example for RSS feed data:

const rssFeedData = {
  title: "My Blog Feed",
  link: "https://example.com",
  description: "The latest articles from my blog.",
  items: [
    {
      title: "First Post",
      link: "https://example.com/post-1",
      description: "A summary of the first post.",
      pubDate: "2024-12-14T10:00:00Z",
    },
  ],
};

3. Generate Feeds

Generate RSS Feed

const rss = generateRSSFeed(rssFeedData);
console.log(rss);

Generate Atom Feed

Atom feeds have a slightly different structure:

const atomFeedData = {
  title: { type: "text", value: "My Blog Feed" },
  updated: "2024-12-14T12:00:00Z",
  id: "https://example.com/atom",
  link: [
    {
      href: "https://example.com/atom",
      rel: "self",
      type: "application/atom+xml",
    },
  ],
  entries: [
    {
      title: { type: "text", value: "First Post" },
      id: "https://example.com/post-1",
      updated: "2024-12-14T10:00:00Z",
      summary: { type: "text", value: "A summary of the first post." },
    },
  ],
};

const atom = generateAtomFeed(atomFeedData);
console.log(atom);

Generate JSON Feed

JSON feeds are defined with the JSONFeed type:

const jsonFeedData = {
  version: "https://jsonfeed.org/version/1.1",
  title: "My Blog Feed",
  home_page_url: "https://example.com",
  feed_url: "https://example.com/feed.json",
  items: [
    {
      id: "https://example.com/post-1",
      title: "First Post",
      content_html: "<p>The full content of the first post.</p>",
      date_published: "2024-12-14T10:00:00Z",
    },
  ],
};

const json = generateJSONFeed(jsonFeedData);
console.log(json);

Feed Validation

To ensure your feeds are valid, use the following online tools:

You can copy and paste the generated feed output into these tools for validation.


API Reference

generateRSSFeed(feedData: RSSFeed): string

Generates an RSS 2.0 feed.

  • Input: RSSFeed object.
  • Output: A string containing the RSS XML.

generateAtomFeed(feedData: AtomFeed): string

Generates an Atom feed.

  • Input: AtomFeed object.
  • Output: A string containing the Atom XML.

generateJSONFeed(feedData: JSONFeed): string

Generates a JSON Feed.

  • Input: JSONFeed object.
  • Output: A string containing the JSON Feed.

Examples

RSS Feed Output

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>My Blog Feed</title>
    <link>https://example.com</link>
    <description>The latest articles from my blog.</description>
    <lastBuildDate>Sat, 14 Dec 2024 12:00:00 GMT</lastBuildDate>
    <item>
      <title>First Post</title>
      <link>https://example.com/post-1</link>
      <description>A summary of the first post.</description>
      <pubDate>Sat, 14 Dec 2024 10:00:00 GMT</pubDate>
    </item>
  </channel>
</rss>

Atom Feed Output

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text">My Blog Feed</title>
  <link href="https://example.com/atom" rel="self" type="application/atom+xml" />
  <id>https://example.com/atom</id>
  <updated>2024-12-14T12:00:00Z</updated>
  <entry>
    <title type="text">First Post</title>
    <id>https://example.com/post-1</id>
    <updated>2024-12-14T10:00:00Z</updated>
    <summary type="text">A summary of the first post.</summary>
  </entry>
</feed>

JSON Feed Output

{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "My Blog Feed",
  "home_page_url": "https://example.com",
  "feed_url": "https://example.com/feed.json",
  "items": [
    {
      "id": "https://example.com/post-1",
      "title": "First Post",
      "content_html": "<p>The full content of the first post.</p>",
      "date_published": "2024-12-14T10:00:00Z"
    }
  ]
}

Contributing

Contributions are welcome! If you'd like to improve this package:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature-name
  3. Make your changes and commit:
    git commit -m "Add new feature"
  4. Push your branch and open a Pull Request.

More Information

  • Follow @Dev4TheWeb on Twitter/X for updates from the creator
  • Follow @Bliztek on Twitter/X for updates from the company side
  • Read our Company blog to learn more about our contributions to open source!
  • Read my Personal blog to learn more about what I do!

License

This package is licensed under the MIT License.


Happy syndicating! 🚀