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

@rapthi/podca-ts

v1.0.4

Published

A TypeScript library for parsing and managing podcast feeds from RSS/iTunes feeds

Readme

podca-ts

npm version License: MIT Node.js Version

A modern, fully-typed TypeScript library for parsing and managing podcast feeds from RSS/iTunes feeds. Built with type safety, error handling, and comprehensive test coverage.

Features

  • 📡 Parse RSS Feeds - Extract podcast metadata from standard RSS feeds
  • 🎵 iTunes Support - Full support for iTunes-specific podcast metadata
  • 🔍 iTunes Search - Search for podcasts using the iTunes Search API
  • 📦 Fully Typed - Complete TypeScript support with strict type checking

Installation

npm install podca-ts
yarn add podca-ts
pnpm add podca-ts

Quick Start

Parse a Podcast Feed

import { PodcastLoader } from 'podca-ts';

const loader = new PodcastLoader();

try {
  const podcast = await loader.getPodcastFromFeed(
    'https://example.com/podcast/feed.xml'
  );

  console.log(`Podcast: ${podcast.title}`);
  console.log(`Episodes: ${podcast.episodes?.length}`);
  
  podcast.episodes?.forEach((episode) => {
    console.log(`- ${episode.title} (${episode.durationInSeconds}s)`);
  });
} catch (error) {
  console.error('Failed to load podcast:', error);
}

Search for Podcasts on iTunes

import { ItunesSearch } from 'podca-ts';

const searcher = new ItunesSearch();

try {
  const results = await searcher.search({
    term: 'javascript',
    media: 'podcast',
    limit: 10,
    country: 'US',
  });

  console.log(`Found ${results.resultCount} podcasts`);
  
  results.results.forEach((podcast) => {
    console.log(`- ${podcast.trackName} by ${podcast.artistName}`);
  });
} catch (error) {
  console.error('Search failed:', error);
}

API Documentation

PodcastLoader

The main class for parsing podcast feeds.

Constructor

const loader = new PodcastLoader();

Methods

getPodcastFromFeed(feedUrl: string): Promise<Podcast>

Fetches and parses a podcast feed from the given URL.

Parameters:

  • feedUrl (string): The URL of the podcast RSS feed

Returns: A Promise that resolves to a Podcast object

Throws:

  • Error if the feed URL is invalid
  • Error if the feed cannot be fetched
  • Error if the feed is malformed or missing required fields
  • Error if the request times out (30 seconds)

Example:

const podcast = await loader.getPodcastFromFeed(
  'https://feeds.example.com/podcast.xml'
);

ItunesSearch

Search for podcasts using the iTunes Search API.

Constructor

const searcher = new ItunesSearch();

Methods

search<T extends MediaType>(option: ITunesSearchParams<T>): Promise<ITunesSearchResponse>

Searches for content on iTunes.

Parameters:

  • option (ITunesSearchParams): Search parameters

Returns: A Promise that resolves to an ITunesSearchResponse object

Throws:

  • Error if the API request fails
  • Error if the response is not OK

Example:

const results = await searcher.search({
  term: 'typescript',
  media: 'podcast',
  limit: 25,
  country: 'US',
  lang: 'en_us',
});

Types

Podcast

interface Podcast {
  title: string;
  description?: string;
  link: string;
  language?: string;
  categories: Category[];
  explicit: boolean;
  imageUrl?: string;
  author?: string;
  copyright?: string;
  fundingUrl?: string;
  type?: string;
  episodes?: Episode[];
}

Episode

interface Episode {
  title?: string;
  guid: string;
  enclosure?: Enclosure;
  linkUrl?: string;
  pubDate?: string;
  description?: string;
  durationInSeconds?: string | number;
  imageUrl?: string;
  explicit?: boolean;
  number?: number;
  season?: number;
  type?: string;
}

Category

interface Category {
  name: string;
}

Enclosure

interface Enclosure {
  url: string;
  type: string;
  length: string;
}

ITunesSearchParams

interface ITunesSearchParams<T extends MediaType> {
  term: string;
  media: T;
  entity?: EntityForMediaType<T>;
  country?: string;
  limit?: number;
  lang?: string;
  version?: number;
  explicit?: 'Yes' | 'No';
}

Error Handling

The library provides detailed error messages to help with debugging:

import { PodcastLoader } from 'podca-ts';

const loader = new PodcastLoader();

try {
  const podcast = await loader.getPodcastFromFeed('invalid-url');
} catch (error) {
  if (error instanceof Error) {
    console.error(error.message);
    // Output: "Invalid feed URL: invalid-url"
  }
}

Requirements

  • Node.js: >= 18.0.0
  • TypeScript: >= 5.0.0 (for development)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © rapthi

Support

If you encounter any issues or have questions, please open an issue on GitHub.

Acknowledgments