Wrapper around feedparser with promises.
$ npm install --save feedparser-promised
const feedparser = require('feedparser-promised');
const url = 'http://feeds.feedwrench.com/JavaScriptJabber.rss';
feedparser.parse(url).then( (items) => {
items.forEach(item => console.log('title:', item.title));
}).catch(error => console.error('error: ', error));
Using HTTP Node.js options
const feedparser = require('feedparser-promised');
const options = {
uri: 'http://feeds.feedwrench.com/JavaScriptJabber.rss',
timeout: 3000,
gzip: true,
// ...
};
feedparser.parse(options).then( (items) => { /* do your magic here */ });
title
: titledescription
: frequently, the full article contentsummary
: frequently, an excerpt of the article contentlink
: linkoriglink
: when FeedBurner or Pheedo puts a special tracking url in thelink
property,origlink
contains the original linkpermalink
: when an RSS feed has aguid
field and theisPermalink
attribute is not set tofalse
,permalink
contains the value ofguid
date
: most recent updatepubdate
: original published dateauthor
: authorguid
a unique identifier for the articlecomments
: a link to the article's comments sectionimage
:an Object containing
urland
title` propertiescategories
: an Array of Stringssource
: an Object containingurl
andtitle
properties pointing to the original source for an article; see the RSS Spec for an explanation of this elementenclosures
: an Array of Objects, each representing a podcast or other enclosure and having aurl
property and possiblytype
andlength
propertiesmeta
: an Object containing all the feed meta properties; especially handy when using the EventEmitter interface to listen toarticle
emissions
There are many ways to contribute, such as fixing opened issues, creating them or suggesting new ideas. Either way will be very appreciated.
If there are issues open, I recommend you follow those steps:
- Create a branch feedparser-promised#{issue_number}; eg: feedparser-promised#42
- Please, remember to write unit tests.
- Send a pull request!
$ npm test
feedparser-promised
is released under the MIT License.