Meet Feedsmith โ
Robust and fast JavaScript parser and generator for RSS, Atom, JSON Feed, and RDF feeds, with support for popular namespaces and OPML files.
Feedsmith provides both 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.
Features โ
Core โ
- Comprehensive Support ๐ฏ โ Supports all major feed formats and feed namespaces.
- Perserves Structure ๐ฆ โ Parsed feed object maintains the original feed structure making it easy to access the data.
- Smart Namespace Handling ๐ง โ Automatically normalizes custom namespace prefixes to standard ones (e.g.,
<custom:creator>
becomesdc.creator
). - Parsing & Generating ๐ฉ โ You can 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).
- Forgiving ๐ค โ Handles malformed or incomplete feeds gracefully. It will extract whatever valid data it can find and ignore missing or invalid elements. This makes it suitable for use with real-world feeds that may not strictly follow specifications.
Performance and Type-Safety โ
- Ultrafast parsing โก โ One of the fastest feed parsers in JavaScript (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 and modern browsers.
- 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 | Parsing | Generating |
---|---|---|---|
RSS | 0.9x, 2.0 | โ | โ |
Atom | 0.3, 1.0 | โ | โ |
JSON Feed | 1.0, 1.1 | โ | โ |
RDF | 0.9, 1.0 | โ | โณ |
Namespaces โ
Name | Prefix | Supported in | Parsing | Generating |
---|---|---|---|---|
Atom | <atom:*> | RSS, RDF | โ | โ |
Dublin Core | <dc:*> | RSS, Atom, RDF | โ | โ |
Syndication | <sy:*> | RSS, Atom, RDF | โ | โ |
Content | <content:*> | RSS, RDF | โ | โ |
Slash | <slash:*> | RSS, Atom, RDF | โ | โ |
iTunes | <itunes:*> | RSS, Atom | โ | โ |
Podcast | <podcast:*> | RSS | โ | โ |
Media RSS | <media:*> | RSS, Atom, RDF | โ | โ |
GeoRSS-Simple | <georss:*> | RSS, Atom, RDF | โ | โ |
Atom Threading | <thr:*> | RSS, Atom | โ | โ |
Dublin Core Terms | <dcterms:*> | RSS, Atom, RDF | โ | โ |
Well-Formed Web | <wfw:*> | RSS, Atom, RDF | โ | โ |
YouTube | <yt:*> | Atom | โ | โ |
Administrative | <admin:*> | ๐ | ๐ | ๐ |
GML | <gml:*> | ๐ | ๐ | ๐ |
GeoRSS GML | <georss:*> | ๐ | ๐ | ๐ |
Other โ
Format | Versions | Parsing | Generating |
---|---|---|---|
OPML | 1.0, 2.0 | โ | โ |
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 format.
Many alternative packages attempt to normalize data by:
- Merging distinct fields like
author
,dc:creator
, andcreator
into a single property. - Combining date fields such as
dc:date
andpubDate
without preserving their sources. - Handling multiple
<atom:link>
elements inconsistently, sometimes keeping only the first or last one or ignoring differentrel
attributes. - Some libraries try to combine different feed formats into one universal structure.
While this approach can be useful for quick reading of feed data, it often results in a loss of information that may be crucial for certain applications, such as reading data from specific namespaces.