feed-slurp
An RSS and Atom feed reader for the browser that uses the DOMParser you already have, and hands back one normalized shape whichever format the feed happens to be.
npm install feed-slurpcopyThe problem
Reading a feed in the browser sounds trivial and is not. You end up shipping fifty kilobytes of XML parser, writing a branch for every place RSS 2.0 and Atom 1.0 disagree about what a tag is called, and then discovering that CORS will not let you fetch the feed at all.
What it does
typescript
import { slurp } from 'feed-slurp';
const feed = await slurp('https://medium.com/feed/@BaryoDev');
console.log(feed.title); // "BaryoDev - Medium"
console.log(feed.items[0].thumbnail); // pulled out of the content for you- No XML library. It uses the browser's native
DOMParser. - One schema. RSS or Atom, you get the same
SlurpFeedandSlurpItemback, so you stop caring which one you were handed. - CORS proxies built in, with presets, or bring your own.
- Caching in localStorage with a configurable TTL, so a reload is not another round trip.
- Thumbnails extracted from the content when the feed does not offer one.
Where it fits
Any page that wants to show someone else's writing: a blog roll, a changelog feed, a dashboard pulling from several sources. This site's own blog page runs on it.