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

@vidpickr/sdk

v0.1.1

Published

Official Node.js SDK for the VidPickr API — download YouTube videos with one function call. No ffmpeg dependency.

Readme

vidpickr

Official Node.js SDK for the VidPickr API. Download YouTube videos with a single function call. No ffmpeg dependency — the SDK bundles a pure-JS MP4 muxer.

import { VidPickr } from '@vidpickr/sdk';

const vp = new VidPickr({ apiKey: process.env.VIDPICKR_API_KEY! });

await vp.download('https://www.youtube.com/watch?v=dQw4w9WgXcQ', {
  out: 'video.mp4',
  quality: 1080,
});

That's it. The SDK:

  1. Resolves the URL through /api/v1/info
  2. Picks the best 1080p video track and the highest-bitrate audio track
  3. Streams both in parallel from the API's /api/v1/stream endpoint
  4. Muxes them on the fly into one MP4 (no temp files, no ffmpeg)
  5. Writes the result to video.mp4

Requirements

  • Node.js 18 or newer (the SDK uses global fetch and Web Streams)
  • A VidPickr Plus subscription ($1/mo) and an API key, minted at vidpickr.com/account/api-keys

Install

npm install @vidpickr/sdk
# or
pnpm add @vidpickr/sdk
# or
yarn add @vidpickr/sdk

Total install footprint is ~1 MB. No native dependencies; works on macOS, Linux, Windows.

API

new VidPickr(options)

Construct the client.

| Option | Type | Required | Default | |----------|-----------------------|----------|----------------------------------------| | apiKey | string | yes | — | | baseUrl| string | no | https://vidpickr.com/api/v1 | | fetch | typeof fetch | no | global fetch |

vp.download(url, options)

Resolve, stream, mux, and write to disk. Returns Promise<void>.

| Option | Type | Required | Description | |--------------|----------------------------|----------|------------------------------------------------------------------------| | out | string | yes | Output file path. Parent directory must exist. | | quality | 'best' \| 'highest' \| 'lowest' \| number | no | Target height in px, or a preset. Default 'best'. | | videoCodec | 'av1' \| 'vp9' \| 'avc' \| 'hevc' | no | Preferred codec when multiple variants exist at the same height. | | onProgress | (p) => void | no | Periodic progress callback (phase, videoBytes, audioBytes, …). | | signal | AbortSignal | no | Cancel mid-download. |

vp.info(url)

Just the resolution step. Returns the full VideoInfo JSON. Useful when you want to inspect format options before deciding what to download.

vp.raw

Low-level access to the HTTP client (info(), openStream()). Use this when you need to build a custom pipeline — e.g. piping the audio track into your own transcription system without writing to disk.

Errors

import { APIError, MuxError, NoFormatError } from '@vidpickr/sdk';

try {
  await vp.download(url, { out: 'x.mp4' });
} catch (e) {
  if (e instanceof APIError && e.code === 'rate_limited') {
    console.log(`Retry in ${e.retryAfter}s`);
  } else if (e instanceof APIError && e.code === 'plus_required') {
    console.log('Upgrade to Plus first.');
  } else if (e instanceof MuxError) {
    console.log('Mux failed — usually a YouTube format we haven\'t mapped yet.');
  } else {
    throw e;
  }
}

Progress reporting

await vp.download(url, {
  out: 'x.mp4',
  onProgress(p) {
    const pct = p.videoTotal > 0
      ? Math.round((p.videoBytes / p.videoTotal) * 100)
      : 0;
    process.stdout.write(`\r${p.phase} · ${pct}%   `);
  },
});

phase values: resolving, fetching, muxing, finalizing, done.

Cancellation

const ac = new AbortController();
setTimeout(() => ac.abort(), 5000);
await vp.download(url, { out: 'x.mp4', signal: ac.signal });

Why no ffmpeg?

YouTube serves video and audio as separate tracks for everything above 720p. Joining them is a container operation, not an encoding one — the bytes themselves stay identical; only the wrapping changes. ffmpeg is overkill for this and adds an ~80 MB install dependency. The SDK uses mp4-muxer (the same library powering VidPickr's web app) to do it natively in JavaScript, in a few seconds of wall-clock time.

License

MIT