feedr v4.8.0
Use feedr to fetch the data from a remote url, respect its caching, and parse its data. Despite its name, it's not just for feed data but also for all data that you can feed into it (including binary data).
npm
Usage
// Create a new feedr instance
const feedr = require('feedr').create({/* optional configuration */})
// Prepare our feeds that we want read
const feeds = {
someAtomFeed: 'https://github.com/bevry/feedr/commits/for-testing.atom'
someJsonFile: 'https://raw.githubusercontent.com/bevry/feedr/for-testing/package.json'
}
// Read a single feed
feedr.readFeed(feeds.someAtomFeed, {/* optional configuration */}, function (err, data, headers) {
console.log(err, data, headers)
})
// Read all the feeds together
feedr.readFeeds(feeds, {/* optional configuration */}, function (err, result) {
console.log(err, result.someAtomFeed, result.someJsonFile)
})Configuration
Feed configuration defaults / global configuration properties are:
logdefaults tonull, log function to usetmpPathdefaults to system tmp path, the tempory path to cache our feedr results tocachedefaults to one day1000*60*60*24, available values: -Numberprefers to use the cache when it is within the range of the number in milliseconds -trueprefers to use the cache when the response headers indicate that the cache is still valid -"preferred"will always use the cache if the cache exists -falsewill never use the cachexml2jsOptionsdefaults tonull, the options to send to xml2jsrequestOptionsdefaults tonull, the options to send to request
Feed configuration properties are:
urlrequired, the url to fetchhashdefaults to hash of the url, the hashed url for cachingnamedefaults to hash, the name of the feed for use in debuggingpathdefaults to tmp feed path, the path to save the file toparsedefaults totrue, whether or not we should attempt to parse the response data, supported values arexml,json,cson,yaml,string,raw/false. Iftruewill try all the available parsers. Can also be a function with the signature({response, data, feed, feedr}, next(err, data))checkdefaults totrue, whether or not we should check the response data for custom error messages. Can also be a function with the signature({response, data, feed, feedr}, next(err))xml2jsOptionsdefaults to global value, the options to send to xml2jsrequestOptionsdefaults to global value, the options to send to request
Discover the release history by heading on over to the HISTORY.md file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
Unless stated otherwise all works are:
and licensed under:
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago