manger

cache feeds

manger - cache feeds

The manger Node module caches RSS and Atom formatted XML feeds using LevelUP. It aggregates updated entries of multiple feeds and time spans into a single request-response.

A LevelUP data store.

Options for a Manger instance.

- db db()
- readableObjectMode Boolean() | false

One metadata object per XML feed.

- author String() | undefined
- copyright String() | undefined
- feed String() | undefined // the URL 
- id String() | undefined
- image String() | undefined
- language String() | undefined
- link String() | undefined
- payment String() | undefined
- subtitle String() | undefined
- summary String() | undefined
- title String() | undefined
- ttl String() | undefined
- updated String() | undefined

A related resource of an entry().

- href String() | undefined
- length String() | undefined
- type String() | undefined

entry()

An individual entry.

- author String() | undefined
- enclosure enclosure() | undefined
- duration String() | undefined
- feed String() | undefined
- id String() | undefined
- image String() | undefined
- link String() | undefined
- subtitle String() | undefined
- summary String() | undefined
- title String() | undefined
- updated String() | undefined
- url String()
- since Date() | undefined

The manger module exports a single function that returns a new cache object (an instance of Manger). To access the Manger class require('manger'). If the cache's readableObjectMode is set to true, results can be read as objects, otherwise as Buffer objects or strings forming an array in proper JSON.

manger leverages the lexicographical key sort order of LevelDB. The keys are designed to stream feeds or entries in time ranges between now and some point in the past.

The distinction between feed and entries may not be clear. A feed models the metadata of an RSS or Atom feed (title, author, published, etc.), while entries are the actual items in the feed. These are detached to not repeatedly transmit feed metadata—after all manger tries to save round-trips.

A Transform stream that transforms queries or URL strings to entries.

- write(query() || String()) Boolean()
- read() Buffer() || String() || entry()

A Transform stream that transforms queries or URL strings to feeds.

- write(query() || String()) Boolean()
- read() Buffer() || String() || feed()

A Readable stream of URLs of all feeds currently cached.

- read() Buffer() || String()

Updates all cached feeds and returns a Readable stream of updated feed objects. manger applies ETags to reduce traffic.

- read() Buffer() || String() || feed()

With npm do:

$ npm install manger

MIT License