Feedsmith
Feedsmith

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 is a fast, all-in-one JavaScript feed parser and generator. It is designed to handle various feed formats and namespaces using a single package for both parsing and generating feeds.

Core Capabilities and Supported Formats

Feedsmith offers comprehensive support for all major feed formats and namespaces.

  • Supported Formats: It supports RSS (0.9x, 2.0), Atom (0.3, 1.0), RDF (0.9, 1.0), and JSON Feed (1.0, 1.1). It supports both parsing and generating for most of these formats.

  • OPML Support: It also supports OPML versions 1.0 and 2.0 for both parsing and generating.

  • Namespace Support: It supports a wide array of popular namespaces, including Atom, Dublin Core, Syndication, Content, iTunes, Podcast, Media RSS, GeoRSS-Simple, and many others across various feed types (RSS, Atom, RDF).

Data Structure and Handling

A key advantage of Feedsmith is its approach to data handling, which prioritizes retaining the integrity of the original feed data:

  • Preserves Structure: The parsed feed object maintains the original feed structure in a clean, object-oriented format. This is crucial because, unlike many alternatives that merge distinct or duplicate fields, Feedsmith preserves the structure exactly as defined in the specific feed format, preventing the loss of information (especially from specific namespaces).

  • Normalization of Elements: It intelligently normalizes legacy elements, upgrading feed elements to their modern equivalents so older formats can be read easily.

  • Smart Namespace Handling: It normalizes custom namespace prefixes to standard ones (for example, <custom:creator> becomes dc.creator).

Leniency and Robustness

Feedsmith is designed to handle the inconsistencies found in real-world feeds:

  • Forgiving Parsing: It gracefully handles malformed or incomplete feeds and extracts valid data, making it suitable for use with feeds that may not strictly follow specifications.

  • Case Insensitivity: It handles fields and attributes regardless of case (lowercase, uppercase, mixed).

  • Namespace URI Tolerance: It accepts non-official namespace URIs, including HTTPS variants, case variations, trailing slashes, and whitespace.

Performance and Developer Features

Feedsmith includes several features focused on performance and type safety:

  • Ultrafast Parsing: It is cited as one of the fastest JavaScript feed parsers.

  • Type-Safe API: It was built with TypeScript and provides complete type definitions for every feed format and namespace.

  • Tree-Shakable: It allows developers to include only the necessary parts of the library, which helps in reducing bundle size.

  • Well-Tested: It includes a comprehensive test suite with over 2000 tests and 99% code coverage.

Compatibility

The tool works in Node.js and modern browsers. Additionally, while built with TypeScript, it works fine with plain JavaScript.