
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@rapthi/podca-ts
Advanced tools
A TypeScript library for parsing and managing podcast feeds from RSS/iTunes feeds
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.
npm install podca-ts
yarn add podca-ts
pnpm add podca-ts
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);
}
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);
}
The main class for parsing podcast feeds.
const loader = new PodcastLoader();
getPodcastFromFeed(feedUrl: string): Promise<Podcast>Fetches and parses a podcast feed from the given URL.
Parameters:
feedUrl (string): The URL of the podcast RSS feedReturns: A Promise that resolves to a Podcast object
Throws:
Error if the feed URL is invalidError if the feed cannot be fetchedError if the feed is malformed or missing required fieldsError if the request times out (30 seconds)Example:
const podcast = await loader.getPodcastFromFeed(
'https://feeds.example.com/podcast.xml'
);
Search for podcasts using the iTunes Search API.
const searcher = new ItunesSearch();
search<T extends MediaType>(option: ITunesSearchParams<T>): Promise<ITunesSearchResponse>Searches for content on iTunes.
Parameters:
option (ITunesSearchParams): Search parametersReturns: A Promise that resolves to an ITunesSearchResponse object
Throws:
Error if the API request failsError if the response is not OKExample:
const results = await searcher.search({
term: 'typescript',
media: 'podcast',
limit: 25,
country: 'US',
lang: 'en_us',
});
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[];
}
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;
}
interface Category {
name: string;
}
interface Enclosure {
url: string;
type: string;
length: string;
}
interface ITunesSearchParams<T extends MediaType> {
term: string;
media: T;
entity?: EntityForMediaType<T>;
country?: string;
limit?: number;
lang?: string;
version?: number;
explicit?: 'Yes' | 'No';
}
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"
}
}
Contributions are welcome! Please feel free to submit a Pull Request.
MIT © rapthi
If you encounter any issues or have questions, please open an issue on GitHub.
FAQs
A TypeScript library for parsing and managing podcast feeds from RSS/iTunes feeds
We found that @rapthi/podca-ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.