SkillAgentSearch skills...

Feedsmith

Fast, all‑in‑one JavaScript feed parser and generator for RSS, Atom, RDF, and JSON Feed, with support for popular namespaces and OPML.

Install / Use

/learn @macieklamberski/Feedsmith
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Feedsmith

codecov npm version license

Fast, all‑in‑one JavaScript feed parser and generator for RSS, Atom, RDF, and JSON Feed, with support for popular namespaces and OPML files.

Feedsmith offers universal and format‑specific parsers that maintain the original feed structure in a clean, object-oriented format while intelligently normalizing legacy elements. Access all feed data without compromising simplicity.

Read full docs ↗   ·   Quick Start   ·   Why Feedsmith?   ·   Benchmarks →


[!IMPORTANT] Feedsmith 3.x is in final stages of development. Check out the v3.x guide to explore new features and learn how to upgrade. Install it with:

npm install feedsmith@next


Features

Core

  • Comprehensive support — Supports all major feed formats and namespaces.
  • Preserves structure — Parsed feed object maintains the original feed structure making it easy to access the data.
  • Smart namespace handling — Normalizes custom namespace prefixes to standard ones (e.g., <custom:creator> becomes dc.creator).
  • Parsing & generating — Use one package for both parsing and generating feeds.

Leniency

  • Normalizes legacy elements — Upgrades feed elements to their modern equivalents so that you never need to worry about reading feeds in older formats.
  • CaSe INSENsiTive — Handles fields and attributes in any case (lowercase, uppercase, mixed).
  • Namespace URI tolerance — Accepts non-official namespace URIs (HTTPS variants, case variations, trailing slashes, whitespace).
  • Forgiving — Gracefully handles malformed or incomplete feeds and extracts valid data. This makes it suitable for use with real-world feeds that may not strictly follow specifications.

Performance

  • Ultrafast parsing — One of the fastest JavaScript feed parsers (see benchmarks).
  • Type-safe API — Built with TypeScript from the ground up, it provides complete type definitions for every feed format and namespace.
  • Tree-shakable — Only include the parts of the library you need, reducing bundle size.
  • Well-tested — Comprehensive test suite with over 2000 tests and 99% code coverage.

Compatibility

  • Works in Node.js 14.0.0+ and modern browsers.
  • Supports both CommonJS and ES modules.
  • Works with plain JavaScript, you don't need to use TypeScript.

Supported Formats

Feedsmith aims to fully support all major feed formats and namespaces in complete alignment with their specifications.

✅ Available   ·   ⌛️ Work in progress   ·   📋 Planned

Feeds

| Format | Versions | Parse | Generate | |--------|----------|-------|----------| | RSS | 0.9x, 2.0 | ✅ | ✅ | | Atom | 0.3, 1.0 | ✅ | ✅ | | RDF | 0.9, 1.0 | ✅ | 📋 | | JSON Feed | 1.0, 1.1 | ✅ | ✅ |

Other

| Format | Versions | Parse | Generate | |--------|----------|-------|----------| | OPML | 1.0, 2.0 | ✅ | ✅ |

Feed Namespaces

| Name | Prefix | Supported in | Parse | Generate | |------|---------|--------------|-------|----------| | Atom | <atom:*> | RSS, RDF | ✅ | ✅ | | Dublin Core | <dc:*> | RSS, Atom, RDF | ✅ | ✅ | | Dublin Core Terms | <dcterms:*> | RSS, Atom, RDF | ✅ | ✅ | | Syndication | <sy:*> | RSS, Atom, RDF | ✅ | ✅ | | Content | <content:*> | RSS, RDF | ✅ | ✅ | | Slash | <slash:*> | RSS, Atom, RDF | ✅ | ✅ | | iTunes | <itunes:*> | RSS, Atom | ✅ | ✅ | | Podcast Index | <podcast:*> | RSS | ✅ | ✅ | | Podlove Simple Chapters | <psc:*> | RSS, Atom | ✅ | ✅ | | Media RSS | <media:*> | RSS, Atom, RDF | ✅ | ✅ | | Google Play Podcast | <googleplay:*> | RSS, Atom | ✅ | ✅ | | Spotify | <spotify:*> | RSS | ✅ | ✅ | | Acast | <acast:*> | RSS | ✅ | ✅ | | RawVoice | <rawvoice:*> | RSS | ✅ | ✅ | | FeedPress | <feedpress:*> | RSS | ✅ | ✅ | | arXiv | <arxiv:*> | Atom | ✅ | ✅ | | OpenSearch | <opensearch:*> | RSS, Atom | ✅ | ✅ | | PRISM | <prism:*> | RSS | ✅ | ✅ | | ccREL | <cc:*> | RSS, Atom | ✅ | ✅ | | Creative Commons | <creativeCommons:*> | RSS, Atom | ✅ | ✅ | | Atom Threading | <thr:*> | RSS, Atom | ✅ | ✅ | | Atom Publishing Protocol | <app:*> | Atom | ✅ | ✅ | | Comment API | <wfw:*> | RSS, Atom, RDF | ✅ | ✅ | | Administrative | <admin:*> | RSS, Atom, RDF | ✅ | ✅ | | Pingback | <pingback:*> | RSS, Atom | ✅ | ✅ | | Trackback | <trackback:*> | RSS, Atom | ✅ | ✅ | | Source | <source:*> | RSS | ✅ | ✅ | | blogChannel | <blogChannel:*> | RSS | ✅ | ✅ | | YouTube | <yt:*> | Atom | ✅ | ✅ | | W3C Basic Geo | <geo:*> | RSS, Atom | ✅ | ✅ | | GeoRSS Simple | <georss:*> | RSS, Atom, RDF | ✅ | ✅ | | RDF | <rdf:*> | RDF | ✅ | ✅ |

Quick Start

This guide will get you up and running with Feedsmith in just a few minutes.

For a full overview of all the features, visit the documentation website.

Installation

npm install feedsmith

Migrating from v1.x? Check out the migration guide.

Parse Any Feed

The simplest way to parse any feed is to use the universal parseFeed function:

import { parseFeed } from 'feedsmith'

// Works with RSS, Atom, RDF, and JSON Feed
const { format, feed } = parseFeed(feedContent)

console.log('Feed format:', format) // rss, atom, json, rdf
console.log('Feed title:', feed.title)

if (format === 'rss') {
  console.log('RSS feed link:', feed.link)
}

Parse Specific Feed Formats

If you know the format in advance, you can use the format-specific parsers:

import {
  parseAtomFeed,
  parseJsonFeed,
  parseRssFeed,
  parseRdfFeed
} from 'feedsmith'

// Parse specific formats
const rssFeed = parseRssFeed('rss content')
const atomFeed = parseAtomFeed('atom content')
const rdfFeed = parseRdfFeed('rdf content')
const jsonFeed = parseJsonFeed('json content')

// Access typed data
rssFeed.title
rssFeed.dc?.creator
rssFeed.items?.[0]?.title

Parse OPML Files

import { parseOpml } from 'feedsmith'

const opml = parseOpml('opml content')

opml.head?.title
opml.body?.outlines?.[0].text
opml.body?.outlines?.[1].xmlUrl

Generate a Feed

import { generateRssFeed } from 'feedsmith'

const rss = generateRssFeed({
  title: 'My Blog',
  link: 'https://example.com',
  description: 'A simple blog',
  items: [{
    title: 'Hello World',
    link: 'https://example.com/hello',
    description: 'My first post',
    pubDate: new Date()
  }]
})

console.log(rss) // Complete RSS XML

// You can also generate other formats:
// - generateAtomFeed() for Atom feeds
// - generateJsonFeed() for JSON feeds
// - generateOpml() for OPML files

Error Handling

If the feed is unrecognized or invalid, an Error will be thrown with a descriptive message.

import { parseFeed, parseJsonFeed } from 'feedsmith'

try {
  const universalFeed = parseFeed('<not-a-feed></not-a-feed>')
} catch (error) {
  // Error: Unrecognized feed format
}

try {
  const jsonFeed = parseJsonFeed('{}')
} catch (error) {
  // Error: Invalid feed format
}

TypeScript Types

Feedsmith provides comprehensive TypeScript types for all feed formats:

import type { Rss, Atom, Json, Opml } from 'feedsmith/types'

// Access all types for a format
type Feed = Rss.Feed
type Item = Rss.Item
type Category = Rss.Category
type Enclosure = Rss.Enclosure

Why Feedsmith?

Why should you use this library over the alternatives?

The key advantage of Feedsmith is that it preserves the original feed structure exactly as defined in each specific feed form

View on GitHub
GitHub Stars586
CategoryCustomer
Updated2d ago
Forks20

Languages

TypeScript

Security Score

100/100

Audited on Mar 28, 2026

No findings