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).
Last updated 5 years ago by bevryme .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install feedr 
SYNC missed versions from official npm registry.

Feedr

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

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

npm

  • Install: npm install --save feedr
  • Require: require('feedr')

Editions

This package is published with the following editions:

  • feedr aliases feedr/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 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:

  • log defaults to null, log function to use
  • tmpPath defaults to system tmp path, the tempory path to cache our feedr results to
  • cache defaults to one day 1000*60*60*24, available values:
    • Number prefers to use the cache when it is within the range of the number in milliseconds
    • true 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 exists
    • false will never use the cache
  • xml2jsOptions defaults to null, the options to send to xml2js
  • requestOptions defaults to null, the options to send to request

Feed configuration properties are:

  • url required, the url to fetch
  • hash defaults to hash of the url, the hashed url for caching
  • name defaults to hash, the name of the feed for use in debugging
  • path defaults to tmp feed path, the path to save the file to
  • parse defaults to true, whether or not we should attempt to parse the response data, supported values are xml, json, cson, yaml, string, raw/false. If true will try all the available parsers. Can also be a function with the signature ({response, data, feed, feedr}, next(err, data))
  • check defaults to true, 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 xml2js
  • requestOptions 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?

Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

Current Tags

  • 4.8.0                                ...           latest (5 years ago)

57 Versions

  • 4.8.0-next.1575881914.fde3ca0f2d2e8bcbf5e35c3fc843d2ec9d9cc252                                ...           5 years ago
  • 4.7.0-next.1575175408.9b0b22983a9f8b5ac8bec1e16efbba7baeac8158                                ...           5 years ago
  • 4.6.0-next.1575148421.198678cfa2bbb760f219f0283af802c2b434fab4                                ...           5 years ago
  • 4.5.0-next.1574662305.603cf4007c96b361edbd0d684ae831c3661a0ffd                                ...           5 years ago
  • 4.5.0-next.1574661713.f4d03cf90d185fd1db0ebcd0da1473f0e3421a56                                ...           5 years ago
  • 4.5.0-next.1574658616.58e9ccc2bfff55fcf19b0170dd9345510fe5c372                                ...           5 years ago
  • 4.5.0-next.1574654071.c19fe27e68577363656aa079398b156e66669904                                ...           5 years ago
  • 4.5.0-next.1574050388.4f4a486e5d5216a9aed11ea569a17e964f034a58                                ...           5 years ago
  • 4.4.0-next.1574020175.9a68376fc92f6b3460b144572c25c77e9b482524                                ...           5 years ago
  • 4.3.0-next.1573600606.9fc78bb1187217849aa210d3b6d1bcf7e3fdf27d                                ...           5 years ago
  • 4.2.0-next.1573297892.676655c61fffc706afb8cd916dc9bebc137dd11b                                ...           5 years ago
  • 4.1.0-next.1573290944.67c723f7c1f29472eddfe9e45ba6772d94e1b73c                                ...           5 years ago
  • 4.8.0                                ...           5 years ago
  • 4.7.0                                ...           5 years ago
  • 4.6.0                                ...           5 years ago
  • 4.5.0                                ...           5 years ago
  • 4.4.0                                ...           5 years ago
  • 4.3.0                                ...           5 years ago
  • 4.2.0                                ...           5 years ago
  • 4.1.0                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           7 years ago
  • 2.13.5                                ...           8 years ago
  • 2.13.4                                ...           8 years ago
  • 2.13.3                                ...           8 years ago
  • 2.13.2                                ...           8 years ago
  • 2.13.1                                ...           8 years ago
  • 2.13.0                                ...           8 years ago
  • 2.12.0                                ...           10 years ago
  • 2.11.1                                ...           10 years ago
  • 2.11.0                                ...           10 years ago
  • 2.10.4                                ...           10 years ago
  • 2.10.3                                ...           10 years ago
  • 2.10.2                                ...           10 years ago
  • 2.10.1                                ...           10 years ago
  • 2.10.0                                ...           10 years ago
  • 2.9.1                                ...           10 years ago
  • 2.9.0                                ...           11 years ago
  • 2.8.0                                ...           11 years ago
  • 2.7.7                                ...           11 years ago
  • 2.7.6                                ...           11 years ago
  • 2.7.5                                ...           11 years ago
  • 2.7.4                                ...           11 years ago
  • 2.7.3                                ...           11 years ago
  • 2.7.2                                ...           11 years ago
  • 2.7.1                                ...           11 years ago
  • 2.7.0                                ...           11 years ago
  • 2.6.0                                ...           11 years ago
  • 2.5.1                                ...           11 years ago
  • 2.5.0                                ...           12 years ago
  • 2.4.4                                ...           12 years ago
  • 2.4.3                                ...           12 years ago
  • 2.4.2                                ...           12 years ago
  • 2.4.1                                ...           12 years ago
  • 2.4.0                                ...           12 years ago
  • 2.3.0                                ...           12 years ago
  • 2.2.0                                ...           12 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (12)
Dev Dependencies (10)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |