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 🙏

© 2025 – Pkg Stats / Ryan Hefner

youtube-summarize

v0.0.7

Published

Summarize YouTube videos

Downloads

9

Readme

YouTube Transcript Summarizer

Overview

The YouTube Transcript Summarizer is a CLI tool that extracts transcripts from YouTube videos and generates executive summaries in Spanish using Google's Generative AI (Gemini). This tool is designed for professionals who need concise, actionable insights from long videos without manually going through the entire content.

Features

  • Extracts transcripts from YouTube videos automatically
  • Summarizes transcripts using Gemini AI (Google Generative AI)
  • Provides structured, professional markdown summaries
  • Supports batch processing of multiple YouTube video URLs
  • Ensures redundancy elimination and highlights key points
  • Saves the generated summary as a markdown (.md) file

Prerequisites

Before using this tool, make sure you have the following installed:

  • Bun runtime
  • A valid Gemini API Key from Google

Installation

To install the required dependencies, run:

bun install

Usage

1. Set up the Gemini API Key

Ensure your API key is set in your environment variables:

export GEMINI_API_KEY=your_google_gemini_api_key

Alternatively, you can add it to your .env file:

GEMINI_API_KEY=your_google_gemini_api_key

2. Run the CLI Tool

Execute the script and input the YouTube video URLs when prompted:

bun run src/main.ts

You will be asked to enter one or multiple YouTube URLs separated by commas.

3. Output

After processing, the script generates a markdown file with the summary:

✅ Resumen guardado en resumen-[video_id]-[timestamp].md

The file contains:

  • A descriptive title
  • Key highlights formatted in bold
  • Subheadings for better readability
  • A markdown structure optimized for publishing

Code Breakdown

processVideo(url: string)

This function:

  1. Extracts the video transcript using YoutubeTranscript.fetchTranscript(url)
  2. Processes the text into a clean transcript array
  3. Sends the processed transcript to Gemini AI for summarization
  4. Saves the AI-generated summary as a markdown file

main()

  • Asks the user for YouTube video URLs via inquirer
  • Calls processVideo(url) for each provided URL

Dependencies

This project relies on the following libraries:

| Dependency | Version | Description | |------------|---------|-------------| | @google/generative-ai | ^0.21.0 | Google Generative AI SDK | | inquirer | ^12.4.2 | CLI prompt handler | | youtube-transcript | ^1.2.1 | Fetches YouTube transcripts | | @types/bun | latest | TypeScript definitions for Bun | | typescript | ^5.0.0 | TypeScript support |

Error Handling

The script includes basic error handling to:

  • Validate the presence of GEMINI_API_KEY
  • Check if the YouTube URL is valid
  • Catch and log errors during transcript fetching and AI processing

Future Improvements

  • Support for multiple languages beyond Spanish
  • Improved error handling for missing transcripts
  • Custom summary length options (short, medium, long)
  • Integration with Google Drive or Notion for automatic storage
  • Web-based interface for a more user-friendly experience

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it as needed.

Author

Developed by Roberto Ríos. Contributions and feedback are welcome!