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

fast-dirpy

v0.3.9

Published

A simple library/CLI to download video from several websites.

Downloads

172

Readme

npm version JSR npm downloads JSDocs License

A simple library/CLI to download youtube(etc.) videos.

Supported Websites

And .m3u8 videos.

[!IMPORTANT] From v0.3.0, .m3u8 downloader is no longer using ffmpeg. And it doesn't provide proxy settings, so, you need to use export https_proxy=http://ip:port to set proxy manually in terminal.

You can use this userscript to extract .m3u8 sources from websites.

Installation

As a library

npm i fast-dirpy

# deno
deno add jsr:@vince-g/fast-dirpy

As a command line tool

npm i fast-dirpy -g

Additional: download ffmpeg

https://www.ffmpeg.org/download.html

Usage

Config file

[!IMPORTANT] fast-dirpy.config can be fast-dirpy.config.['ts', 'mts', 'cts', 'js', 'mjs', 'cjs', 'json']

You can create a fast-dirpy.config file in your library root or same location in command line.

import { defineConfig } from 'fast-dirpy'

export default defineConfig({
  proxy: {
    protocol: 'http',
    host: '127.0.0.1',
    port: 7890,
  },
  timeout: 20000, // request timeout: 20s
  puppeteer: {
    // Path to Chrome. Please notice that you must give the inner unix executable file path in macOS.
    // /Applications/Google Chrome.app will not work.
    executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
    headless: true
  }
}

Use in command line

[!IMPORTANT] Some website listed in Supported Websites requires Google Chrome installed for Puppeteer use. You have to use a config file or give parameter of puppeteer executable path.

Get Direct Link

# get video direct link
# Proxy:
#   -H, --proxyHost: proxy host
#   -P, --proxyPort: proxy port
#   -c, --config: Specified external config file.
#       e.g.: fast-dirpy get https://xxx -c ~/Downloads/fast-dirpy.config.json
#   --chromePath: Path to your Google Chrome browser.
fast-dirpy get https\://www.youtube.com/watch\?v\=6c28qWDMPBA -H 127.0.0.1 -P 7890

# Bilibili source doesn't need any proxy, so it's disabled by default.
fast-dirpy get https://www.bilibili.com/video/BV1TSPeeGE35

if you have set your proxy config in fast-dirpy.config.ts, you can omit proxy parameters:

fast-dirpy get https\://www.youtube.com/watch\?v\=6c28qWDMPBA

Download Video

[!IMPORTANT]

  1. Some website listed in Supported Websites requires Google Chrome installed for Puppeteer use. You have to use a config file or give parameter of puppeteer executable path.
  2. .m3u8 source is handled by ffmpeg.
# get video direct link
# Path: --path, -p: Downloaded video save path.
#
# Proxy:
#  -H, --proxyHost: proxy host.
#  -P, --proxyPort: proxy port.
#  -c, --config: Specified external config file.
#       e.g.: fast-dirpy get https://xxx -c ~/Downloads/fast-dirpy.config.json
#  --chromePath: Path to your Google Chrome browser.
fast-dirpy download https\://www.youtube.com/watch\?v\=6c28qWDMPBA -p ./test.mp4  -H 127.0.0.1 -P 7890

# Bilibili source doesn't need any proxy, so it's disabled by default.
fast-dirpy download https\://www.bilibili.com/video/BV1TSPeeGE35 -p ./test.mp4

# m3u8 sources
fast-dirpy download https\://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8 -p ./test.mp4

# mp4 sources
fast-dirpy download http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 -p ./big_buck_bunny.mp4

if you have set your proxy config in fast-dirpy.config.ts, you can omit proxy parameters:

fast-dirpy download https\://www.youtube.com/watch\?v\=6c28qWDMPBA -p ./test.mp4

For further CLI help:

fast-dirpy --help

Use as a library

import { fastLink, fastDownload, remoteM3U8ToMP4, downloadVideo } from 'fast-dirpy'

// get direct link, returns string or object(some cases)
const link = await fastLink(
  {
    url: '<url>',
    cwd: '/path/to/external-config' // Optional: You can specify an external config file.
  },
  // options (Optional, can be omitted if you have a config file, this will overwrites your config file options.)
  {
    proxy: { ... }
  }
)

// download video
await fastDownload({
  url: '<url>',
  path: './download.mp4',
  cwd: '/path/to/external-config', // Optional: You can specify an external config file.
},
// options (Optional, can be omitted if you have a config file, this will overwrites your config file options.)
{
  proxy: { ... }
})

// Download `.m3u8` video
await remoteM3U8ToMP4({
  url: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
  path: './test.mp4',
})

// Download `.mp4` video
await downloadVideo({
    url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4',
    path: "./big_buck_bunny.mp4"
})

Test

To run single test case in Vitest, using:

pnpm run test src/test/xxx.test.ts:<line_number>

License

MIT License © 2025-PRESENT Vincent-the-gamer