Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

node-feedsub

> 编程语言
Open source

Subscribes to RSS/Atom/JSON feeds and notifies on new items.

198 stars0 likes0 views
WebsiteGitHub

About

Subscribes to RSS/Atom/JSON feeds and notifies on new items.

FeedSub

FeedSub subscribes to a remote RSS/Atom/JSON feed and notifies you of any new items it reads.

It works by checking the feed every once in a while, comparing the date of the document via a conditional GET if supported. Otherwise it looks for a date tag in the feed. If it's the same as the last date, it stops downloading it and parsing the xml/json. If it's an updated document, then it looks through it top to bottom taking note of all the new items. Once it finds something it has already read, it stops downloading and parsing the document.

Usage

javascript
const FeedSub = require('feedsub');

let reader = new FeedSub('http://rss.cnn.com/rss/cnn_latest.rss', {
  interval: 10 // Check feed every 10 minutes.
});

reader.on('item', (item) => {
  console.log('Got item!');
  console.dir(item);
});

reader.start();

API

new FeedSub(feed, [options])

Creates a new instance of FeedSub. options defaults to.

…

FeedSub#read([callback(err, items)])

Reads the feed. Calls callback with possible error or new items discovered if provided. Causes reader to emit new item events.

FeedSub#start(readOnStart)

Starts checking the feed for any new items every options.interval minutes. If readOnStart is true, it checks right away.

FeedSub#options

Options that were passed to the constructor along with any defaults are kept here.

FeedSub#stop()

Stops the reader from automatically reading the feed.

Event: item

  • Object - Item.

Emitted whenever there is a new item.

Event: items

  • Array. - List of items.

Emits all new items from one request in one array.

Event: error

  • Error

Emitted when there is an error downloading or parsing the feed. Not emitted if callback is given for read or readInterval.

Install

bash
npm install feedsub

Tests

Tests are written with mocha

bash
npm test

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptatomfeed-readernoderss

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言