Feedr
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).
Install
- Install:
npm install --save feedr
- Require:
require('feedr')
Editions
This package is published with the following editions:
feedr
aliasesfeedr/source/index.js
feedr/source/index.js
is esnext source code with require for modules
Environments older than Node.js v8 may need Babel's Polyfill or something similar.
Usage
// Create a new feedr instanceconst feedr =// Prepare our feeds that we want readconst 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 feedfeedr// Read all the feeds togetherfeedr
Configuration
Feed configuration defaults / global configuration properties are:
log
defaults tonull
, log function to usetmpPath
defaults to system tmp path, the tempory path to cache our feedr results tocache
defaults to one day1000*60*60*24
, available values:Number
prefers to use the cache when it is within the range of the number in millisecondstrue
prefers to use the cache when the response headers indicate that the cache is still valid"preferred"
will always use the cache if the cache existsfalse
will never use the cache
xml2jsOptions
defaults tonull
, the options to send to xml2jsrequestOptions
defaults tonull
, the options to send to request
Feed configuration properties are:
url
required, the url to fetchhash
defaults to hash of the url, the hashed url for cachingname
defaults to hash, the name of the feed for use in debuggingpath
defaults to tmp feed path, the path to save the file toparse
defaults totrue
, whether or not we should attempt to parse the response data, supported values arexml
,json
,cson
,yaml
,string
,raw
/false
. Iftrue
will try all the available parsers. Can also be a function with the signature({response, data, feed, feedr}, next(err, data))
check
defaults 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))
xml2jsOptions
defaults to global value, the options to send to xml2jsrequestOptions
defaults to global value, the options to send to request
History
Discover the release history by heading on over to the HISTORY.md
file.
Contribute
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Backers
Maintainers
These amazing people are maintaining this project:
Sponsors
No sponsors yet! Will you be the first?
Contributors
These amazing people have contributed code to this project:
- Benjamin Lupton — view contributions
- Zearin — view contributions
- dependabot[bot] — view contributions
- dependabot-preview[bot] — view contributions
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
License
Unless stated otherwise all works are:
- Copyright © 2012+ Bevry Pty Ltd
and licensed under: