npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

feederjs

v1.0.3

Published

An RSS/Atom feed parser that converts RSS and Atom Feeds to a single object type.

Downloads

9

Readme

Welcome to my first node module!

feederjs

feederjs is a small, simple to use Atom and RSS parser. It uses the fast and lightweight sax-js Sax parser to parse an Atom or RSS feed into a single JavaScript Object type that mimics the structure (but not exactly) of the Atom Specification.

What this is intended to be:
  • Simple to Implement
  • Simple to Use
What this is NOT intended to be:
  • A Robust feature Rich API
  • One stop library for all Atom/RSS needs

Examples

Install with: > npm install --save feederjs To retreive a feed is very simple. Let's examine the following code.

const feeder = require('feederjs');
feeder.getFeed('http://feeds.reuters.com/news/artsculture?format=xml', (feed) => { console.log(feed.title); });

would output

"Reuters: Arts"

Sometimes, we Err. If your passed url does not specify a protocol, or if the url does not lead to a feed or rss xml object. A FeederException will be thrown. To catch this, consider:

feeder.getFeed('https://google.com', (feed) => {
  if (feed instanceof feeder.FeederException){
    console.log('error: ' + feed.message);
  } else {
    console.log(feed.title);
  }
});

Pretty simple, right? While feederjs aims to be simple, this limits it's use cases. If you are looking for a parser that is more structured around the RSS Specification you might want to try feedparser. Or if you are looking for in depth parsing of the xml structure, you may want to look at sax-js.

Documentation

Documentation can be found Here.

License

MIT

Contributions

Pull and feature requests are welcome. Please use the linting rules in the eslint file. Please open an issue or comment on an existing one to outline your intent of the the Pull Request.

ToDo

  • Add support for reading from files and streams
  • Add support for returning Promises as well as objects.