npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

feedfinder-ts

v1.0.3

Published

A TypeScript library for finding RSS and Atom feeds on websites

Readme

feedfinder-ts

A TypeScript library for discovering RSS and Atom feeds from website URLs through HTML parsing and intelligent path detection, compatible with both Node.js and browsers.

This is a TypeScript port of the original Go implementation, mostly ported by AI.

Features

  • URL-based Feed Discovery: Automatically discovers RSS and Atom feeds from any website URL
  • Intelligent HTML Parsing: Searches for feed links in <link> and <a> tags within web pages
  • Smart Path Detection: Checks common feed file locations and well-known paths
  • Universal: Works in both Node.js (≥22) and browser environments
  • Fast: Concurrent processing for optimal performance
  • Type Safe: Full TypeScript support with comprehensive type definitions
  • Third-party Services: Additional support for GitHub, Reddit, and YouTube feeds

Installation

npm install feedfinder-ts

Usage

Basic Usage

import { find } from "feedfinder-ts";

// Discover feeds from a blog or news website
const feeds = await find("https://example.com/blog");
console.log(feeds);
// Output:
// [
//   { title: "Latest Posts", link: "https://example.com/feed.xml" },
//   { title: "RSS Feed", link: "https://example.com/rss.xml" },
//   { title: "Blog Updates", link: "https://example.com/atom.xml" }
// ]

// Works with any website that has RSS/Atom feeds
const newsFeeds = await find("https://news.ycombinator.com");

With Options

import { find } from "feedfinder-ts";

const feeds = await find("https://example.com/blog", {
  timeout: 30000,
  userAgent: "My App/1.0.0",
  headers: {
    "Accept-Language": "en-US,en;q=0.9",
  },
});

Using the FeedFinder Class

import { FeedFinder } from "feedfinder-ts";

const finder = new FeedFinder("https://example.com/blog", {
  timeout: 60000,
});

const feeds = await finder.find();
console.log(feeds);

How It Works

The library discovers feeds from URLs using multiple intelligent strategies:

1. HTML Parsing (Primary Method)

The core feed discovery method that analyzes web page content:

  • Link tag analysis: Searches for <link> tags with feed types:
    • application/rss+xml
    • application/atom+xml
    • application/json
    • application/feed+json
  • Anchor tag discovery: Finds <a> tags containing "RSS", "Feed", or "Atom" text
  • Content-based detection: Intelligently parses HTML to locate feed references

2. Well-known Path Detection

Systematically checks common feed file locations:

  • Standard feed files: atom.xml, feed.xml, rss.xml, index.xml
  • JSON feeds: atom.json, feed.json, rss.json, index.json
  • Common directories: feed/, rss/

Searches both under the target URL path and the root domain for comprehensive coverage.

3. Third-party Services (Additional Support)

Enhanced support for popular platforms:

  • GitHub: Repository feeds (commits, releases, tags, wiki), user feeds
  • Reddit: Subreddit feeds (hot, new, top, rising), user feeds, comment feeds
  • YouTube: Channel and playlist feeds (extracted from page content)

API Reference

find(target: string, options?: FeedFinderOptions): Promise<Feed[]>

Main entry point to find feeds for a given URL.

Parameters:

  • target: The URL to search for feeds
  • options: Optional configuration object

Returns: Promise that resolves to an array of Feed objects

FeedFinderOptions

interface FeedFinderOptions {
  requestProxy?: string; // HTTP proxy URL
  timeout?: number; // Request timeout in milliseconds (default: 60000)
  userAgent?: string; // Custom User-Agent header
  headers?: Record<string, string>; // Additional HTTP headers
}

Feed

interface Feed {
  title: string; // Feed title
  link: string; // Feed URL
}

Browser Support

The library works in modern browsers that support:

  • ES2020 features
  • Fetch API
  • AbortController

For older browsers, you may need polyfills.

Node.js Support

Requires Node.js ≥22.0.0.

Development

# Install dependencies
pnpm install

# Run tests
pnpm test

# Run tests with coverage
pnpm run test:coverage

# Build the library
pnpm run build

# Run linting
pnpm run lint

# Type checking
pnpm run typecheck

Credits

License

MIT