JSPM

@mrlvn/easy-dl

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q42094F
  • License MIT

A simple downloader wrapper for yt-dlp and ffmpeg, with Node.js and Bun support.

Package Exports

  • @mrlvn/easy-dl

Readme

easy-dl

npm version npm downloads

A simple and flexible library downloader for audio and video using yt-dlp and ffmpeg.
Supports both Node.js and Bun.

📦 Installation

Using NPM

npm install @mrlvn/easy-dl

Using BUN

bun add @mrlvn/easy-dl

Using YARN

yarn add @mrlvn/easy-dl

Using PNPM

pnpm add @mrlvn/easy-dl

🚀 Usage

CommonJS

const download = require("@mrlvn/easy-dl");

ESModule or TypeScript

import download from "@mrlvn/easy-dl";

📚 Examples

import download from "@mrlvn/easy-dl";

(async() => {
    // Example 1: Video as Buffer
    const videoBuffer = await download("https://youtu.be/dQw4w9WgXcQ", { type: "video" });

    // Example 2: Audio to File
    await download("https://youtu.be/dQw4w9WgXcQ", {
        type: "audio",
        output: "rickroll.mp3"
    });

    // Example 3: With Cookies
    await download("https://www.youtube.com/watch?v=dQw4w9WgXcQ", {
        type: "video",
        output: "video.mp4",
        cookies: "./cookies.txt"
    });
})();

⚙️ Options (DownloadOptions)

Option Type Default Description
mode "audio" | "video" "audio" Choose whether to download audio or video.
format string? auto Output format (mp3, mp4, flac, etc).
quality string? best Quality setting (e.g. 320k, 1080p, best).
output string? undefined If provided, saves output to this file. If omitted, returns a Buffer.
cookies string? undefined Path to cookies file (Netscape/Chrome format) for authenticated downloads.

📜 License

This project is licensed under the MIT License.
See the LICENSE file for details.