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

srt-cli

v0.3.4

Published

Simple CLI tool to generate .srt files

Readme

srt-cli

A small Command Line Input (CLI) that takes subtitle text and converts it into a .srt file.

Why?

While watching re:zero season 3 I noticed the re:zero break time season 3 was airing simultaneously.

I wanted to watch the break time episodes with subtitles but couldn't find any. That is until I saw a commentor by the name of @KakoeiSbi who translated the break time episodes in a specific format.

I decided then to create a CLI that would take the text and convert it into a .srt file and optionally download the matching video from YouTube.

Optional YouTube Flow

If you paste a YouTube URL at the first prompt, the CLI will:

  1. Fetch the video metadata with yt-dlp
  2. Download the video with yt-dlp
  3. Infer the video length automatically
  4. Create a temporary .srt
  5. Create a new .subbed.mkv video with the subtitles embedded using ffmpeg
  6. Delete the temporary .srt and the original downloaded video when embedding succeeds

While the CLI is downloading, parsing, or writing files, it now shows a small loading state in the terminal.

If you press Enter instead, the CLI falls back to the original manual flow and asks for the video length and output file name.

To use the YouTube flow, make sure yt-dlp and ffmpeg are installed and available in your PATH.

You can also pass the URL directly as the first CLI argument:

bun run src/index.ts "https://www.youtube.com/watch?v=..."

If the URL contains ? or &, wrap it in quotes so your shell does not interpret it.

After loading a YouTube video, the CLI automatically tries to import subtitle text from a YouTube comment left by @KakoeiSbi. The author matching is fuzzy, so it can still match handle, channel URL, or similar author identifiers returned by yt-dlp. If no matching parseable comment is found, it falls back to manual subtitle entry.

When a video is downloaded from YouTube, the CLI creates a final .subbed.mkv file with the subtitles embedded as a subtitle track. If ffmpeg succeeds, the temporary .srt and the original downloaded video are deleted. If ffmpeg fails, those intermediate files are left in place so you can recover manually.

Run script from npm

npx srt-cli

Then follow the CLI steps.

The text entered should follow the format:

(mm:ss) <character>: "<dialogue>"

Each subtitle should be entered on its own line.

You can also place multiple subtitle entries on the same line by separating them with #:

(mm:ss) <character>: "<dialogue>" # mm:ss <character>: "<dialogue>"

The comment import feature expects the same subtitle format inside the YouTube comment text, but the comment can also include extra commentary before, after, or between subtitle lines. The CLI now extracts only the lines that look like subtitles.

Run Locally

To install dependencies:

bun install

To run:

bun run src/index.ts

The first prompt accepts an optional YouTube URL. Leave it blank to use manual mode.

You can skip that first prompt by passing a quoted YouTube URL as the first argument.

This project was created using bun init in bun v1.1.30. Bun is a fast all-in-one JavaScript runtime.