Giter Site home page Giter Site logo

feed-rs's Introduction

Fastest RSS parser in the NPM 🚀

Thanks to the power of Rust and the upstream repository authors, this package is the fastest RSS parser you can find.

Description

Feed parser for Node.js. List of supported feeds

  • RSS0
  • RSS1
  • RSS2
  • Atom
  • JSON

This package contains Node.js bindings from the Rust crate feed_rs.

I've tried to be as much compliant as possible with the original package's models. The Rust crate also contains lots of helpful comments, which I've also included in this package.

Installation

npm install @nooptoday/feed-rs

Usage

import { parse } from '@nooptoday/feed-rs'

const response = await fetch('https://nooptoday.com/rss')
const rss = await response.text()
const feed = parse(rss, 'https://nooptoday.com')

console.log(feed) // Feed Object

Error Handling

As long as the input contains valid feed data, there shouldn't be any errors. In case something goes wrong, these are all the possible errors you might encounter.

no root element
unsupported content type {mime}
missing content element {element}
unable to read feed: {reason}
unable to parse JSON: {reason}
unsupported version: {version}
unable to parse XML: {reason}

Benchmark

Test results are obtained from a local M2 Air installation.

feed-rs          2367 ops/s, ±0.39%   | fastest
fast-xml-parser  1198 ops/s, ±0.26%   | 49.39% slower
rss-parser:      125 ops/s,  ±2.27%   | slowest, 94.72% slower

feed-rs's People

Contributors

mkadirtan avatar

Stargazers

Jeff Caldwell avatar  avatar May avatar Metin Ağaoğlu avatar  avatar Halil Kaya avatar Hüseyin Okumuş avatar Eren Yatkın avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.