youtube-duration

JSON →
library 1.0.0 ·javascript
verified Jun 4, 2026

A lightweight utility to parse and format ISO 8601 duration strings (used by YouTube API v3) into human-readable time strings (e.g., '3:11') or total seconds. v1.0.0 is the current stable version. It focuses solely on duration formatting/conversion with no dependencies, making it ideal for serverless or browser projects. Unlike moment-duration-format, it is YouTube-API-tailored and much smaller.