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

yt-rip

v1.0.1

Published

Cross-platform YouTube video and playlist downloader CLI and Node.js / Bun library powered by yt-dlp and ffmpeg.

Readme

yt-rip

Cross-platform, reliable media and playlist downloader CLI and Node.js / Bun library with automatic retry handling, stream multiplexing, and live progress reporting.


Key Highlights

  • Cross-Platform Compatibility: Tested and supported across Windows, macOS, and Linux.
  • Configurable Retry Engine: Built-in exponential retry policy handles transient drops, rate limits, and network hiccups automatically.
  • Live Terminal Progress Bar: Interactive CLI progress visualization with download speed, downloaded percentage, ETA, and size metrics.
  • Progress Callback Hook: Programmatic onProgress hook gives your custom apps granular real-time transfer stats.
  • Dual Module Exports: Comprehensive native support for ES Modules (import) and CommonJS (require) with complete TypeScript declarations.
  • Stream Merging: Uses bundled ffmpeg-static or detects system FFmpeg to merge high-resolution video and audio streams into single containers (mp4, mkv, mp3, etc.).

Installation

Instant Execution (No install required)

npx yt-rip "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

Global CLI Installation

npm install -g yt-rip

Add to Project Dependencies

npm install yt-rip

Command-Line Usage

yt-rip <url> [options]
# or: ytd <url> [options]

Command Options

| Option | Shorthand | Description | Default | |---|---|---|---| | --output <dir> | -o | Destination directory for saved files | ./downloads | | --template <str> | -t | yt-dlp filename output template | %(title)s.%(ext)s | | --format <selector> | -f | Stream format selector | bestvideo[ext=mp4][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best | | --merge <ext> | -m | Container extension to merge streams | mp4 | | --retries <number> | -r | Number of retries on transient errors | 3 | | --retry-delay <ms> | | Delay between retry attempts in milliseconds | 2000 | | --no-playlist | | Download only the target video if URL is part of a playlist | false | | --ffmpeg <path> | | Specify explicit path to an FFmpeg binary | Auto-detected | | --quiet | | Suppress progress output and notifications | false | | --version | -v | Display package version | | | --help | -h | Display help screen | |


Common CLI Recipes

1. Basic Single Video Download

ytd "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

2. Download Entire Playlist to Specific Folder

ytd "https://www.youtube.com/playlist?list=PL12345" -o ./courses

3. Extract High-Quality Audio as MP3

ytd "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -f "bestaudio/best" -m mp3 -o ./music

4. Robust Download with 5 Retries on Unstable Connections

ytd "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -r 5 --retry-delay 3000

5. Download Single Video from a Playlist URL

ytd "https://www.youtube.com/watch?v=dQw4w9WgXcQ&list=PL12345" --no-playlist

Programmatic API

TypeScript & ES Modules

import { download, parseProgressLine, getFfmpegPath } from 'yt-rip';

async function run() {
  const result = await download('https://www.youtube.com/watch?v=dQw4w9WgXcQ', {
    outputDir: './downloads',
    retries: 3,
    retryDelayMs: 2000,
    onProgress: (progress) => {
      console.log(`[${progress.percent}%] Speed: ${progress.speed} - ETA: ${progress.eta}`);
    }
  });

  console.log(`Completed in ${result.attempts} attempt(s):`, result.outputDir);
}

run().catch(console.error);

CommonJS

const { download } = require('yt-rip');

download('https://www.youtube.com/watch?v=dQw4w9WgXcQ', {
  outputDir: './media',
  retries: 2
})
.then(res => console.log('Downloaded successfully:', res))
.catch(err => console.error('Download error:', err.message));

Verification & Testing

The package includes a comprehensive test suite executed with Node's native test runner:

# Run unit and integration tests
npm test

# Verify TypeScript types
npm run typecheck

# Build distributions
npm run build

License

MIT