{"id":16467324,"url":"https://github.com/elforastero/pulse-feed-parser","last_synced_at":"2025-10-30T07:08:19.658Z","repository":{"id":42728746,"uuid":"259041647","full_name":"ElForastero/pulse-feed-parser","owner":"ElForastero","description":"🚀 Lightweight and robust RSS, Atom and JSON feed parser built for browser environment","archived":false,"fork":false,"pushed_at":"2023-01-07T20:40:34.000Z","size":4694,"stargazers_count":7,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T15:02:00.024Z","etag":null,"topics":["atom","atom-feed-parser","feed","rss","rss-feed-parser","rss-parser"],"latest_commit_sha":null,"homepage":"https://chrome.google.com/webstore/detail/pulse-feed-reader/lcobhhomehlpbfhobkimfcnohdchjdke","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ElForastero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-26T13:47:10.000Z","updated_at":"2023-03-08T15:05:09.000Z","dependencies_parsed_at":"2023-02-08T01:15:20.158Z","dependency_job_id":null,"html_url":"https://github.com/ElForastero/pulse-feed-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ElForastero/pulse-feed-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fpulse-feed-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fpulse-feed-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fpulse-feed-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fpulse-feed-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElForastero","download_url":"https://codeload.github.com/ElForastero/pulse-feed-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fpulse-feed-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020080,"owners_count":26086806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atom","atom-feed-parser","feed","rss","rss-feed-parser","rss-parser"],"created_at":"2024-10-11T11:46:58.475Z","updated_at":"2025-10-14T17:24:04.486Z","avatar_url":"https://github.com/ElForastero.png","language":"TypeScript","readme":"## RSS Pulse Feed Parser\n\n![build](https://github.com/ElForastero/pulse-feed-parser/workflows/build/badge.svg?branch=master)\n![David](https://img.shields.io/david/elforastero/pulse-feed-parser)\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/pulse-feed-parser?label=size)\n![npm](https://img.shields.io/npm/v/pulse-feed-parser)\n\n\u003e This is a lightweight and robust RSS, Atom and JSON feeds parser with no dependencies.\n\u003e\n\u003e [Pulse Feed Reader](https://chrome.google.com/webstore/detail/pulse-feed-reader/lcobhhomehlpbfhobkimfcnohdchjdke) is an example of using this parser.\n\u003e\n\u003e NOTE: The library is under development, so the bugs can happen, and the API may change.\n\nIt was designed to be running right in the browser, but you can easily use it in the Node.js environment.\n\n- 📦 Lightweight (~5kb)\n- 🚀 Fast (using Web API)\n- 👌 No dependencies\n- 😲 IE 9+ ([note](#polyfills))\n- 🏗 Extendable\n- 👮‍♂️ Typed with TypeScript\n\n### Supported Feed Types:\n\n- RSS 0.90, 0.92, 0.93, 0.94, 1.0, 2.0\n- Atom 0.3, 1.0\n- Netscape RSS 0.91\n- Userland RSS 0.91\n\n### Core Concepts\n\n`pulse-feed-parser` is build upon [DOMParser](https://developer.mozilla.org/ru/docs/Web/API/DOMParser) and [TreeWalker](https://developer.mozilla.org/ru/docs/Web/API/TreeWalker).\nNowadays there's no need in third-party XML or JSON parsers.\nAll things we need work well out of the box in every modern browser since IE9.\n\nIt parses the given URL or Document instance, detecting the type of the given feed, and unifies the result into common Feed structure.\n\nFeed is the universal Feed type that Atom and RSS gets translated to. It represents a web feed.\n\n```ts\nexport type Feed = {\n  title: Maybe\u003cstring\u003e;\n  description: Maybe\u003cstring\u003e;\n  link: Maybe\u003cstring\u003e;\n  feedLink: Maybe\u003cstring\u003e;\n  updated: Maybe\u003cstring\u003e;\n  published: Maybe\u003cstring\u003e;\n  author: Maybe\u003cPerson\u003e;\n  language: Maybe\u003cstring\u003e;\n  image: Maybe\u003cImage\u003e;\n  copyright: Maybe\u003cstring\u003e;\n  generator: Maybe\u003cstring\u003e;\n  categories: Maybe\u003cArray\u003cstring\u003e\u003e;\n  items: Maybe\u003cArray\u003cItem\u003e\u003e;\n  feedType: 'rss' | 'atom';\n  feedVersion: string;\n  extensions: Maybe\u003cExtensions\u003e;\n};\n```\n\n### Extensions\n\nExtensions found in feeds will be saved into `extensions` property this way:\n\n```ts\n{\n  // ...\n  extensions: {\n    // Extension name\n    dc: {\n      // Extension property containing an array\n      creator: [\n        {\n          name: 'creator',\n          value: 'John Doe',\n          attrs: null,\n          children: null,\n        },\n      ];\n    }\n  }\n}\n```\n\nYou can use this data on your own - mix it with the main feed data (like titles, dates, descriptions, etc.) or handle it differently.\n\n### Invalid Feeds\n\nThis library can successfully handle any XML document, no matter it follows strictly the RSS spec, or not. As long as it can be parsed with DOMParser, it should work.\n\n### Polyfills\n\nIf you are running `pulse-rss-parser` in the browser environment, and you indeed need to support too old browsers, you have to include some polyfills, which with high probability you are already using:\n\n- Array.includes\n- Map\n- fetch\n- Promise\n\n### Running in Node.js\n\nNode.js doesn't have some Web APIs used in `pulse-rss-parser`, so you should take care of them.\nYou can use jest's [jsdom](https://github.com/jsdom/jsdom) for things such as DOMParser and TreeWalker. For `fetch` [node-fetch](https://github.com/node-fetch/node-fetch) can be used.\n\n### Error Handling\n\nThere are 2 exception types, representing different circumstances that broke the parsing process:\n\n- NetworkError - thrown if fetch got in response status different from 2xx\n- FeedTypeError - thrown if it's impossible to detect the type of the feed\n\n### Examples\n\n**Parsing from a URL**\n\n```ts\nimport { Parser } from 'pulse-feed-parser';\n\nconst feedURL = 'https://github.blog/feed/';\nconst feed: Feed = await new Parser().parseURL(feedURL);\n```\n\n**Parsing a Document instance**\n\n```ts\nimport { Parser, Feed } from 'pulse-feed-parser';\n\nconst content = `\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\u003crss\u003e...`;\nconst doc = new DOMParser().parseFromString(content, 'application/xml');\nconst feed: Feed = await new Parser().parseDocument(doc);\n```\n\n**Error handling**\n\n```ts\nimport { NetworkError, FeedTypeError, Parser } from 'pulse-feed-parser';\n\ntry {\n  const feed: Feed = await new Parser().parseURL(url);\n} catch (e) {\n  if (e instanceof NetworkError) {\n    console.log('Some problems with network');\n  } else if (e instanceof FeedTypeError) {\n    console.log('Unknown feed type');\n  }\n}\n```\n\n**Manually detecting feed type**\n\n```ts\nimport { XmlFeedTypeDetector, FeedType } from 'pulse-feed-parser';\n\nconst type: FeedType = XmlFeedTypeDetector.detect(document);\n```\n\n**Calling concrete parser directly**\n\n```ts\nimport { AtomParser, RSSParser, Atom, RSS } from 'pulse-feed-parser';\n\nconst atomFeed: Atom = new AtomParser(document).parse();\nconst rssFeed: RSS = new RSSParser(document).parse();\n```\n\n### Useful Links\n\n- [RSS Best Practices Profile](http://www.rssboard.org/rss-profile)\n- [Dublin Core™ Metadata Element Set](https://www.dublincore.org/specifications/dublin-core/dces/)\n- [Apple's iTunes](https://help.apple.com/itc/podcasts_connect/#/itcb54353390)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felforastero%2Fpulse-feed-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felforastero%2Fpulse-feed-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felforastero%2Fpulse-feed-parser/lists"}