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

@echovisionlab/youtube-audio

v0.1.6

Published

Authenticated server-side YouTube audio resolution and byte-range proxying.

Readme

YouTube audio

Server-side YouTube audio source resolution and authenticated byte-range proxying for applications that perform browser-local audio processing.

pnpm add @echovisionlab/youtube-audio

The browser receives a same-origin opaque source URL, not the upstream media URL. Integrators must authenticate every resolve and range request, derive the subject from the server-side session, and store short-lived source records in a shared subject-bound store.

import { createYoutubeAudioService } from "@echovisionlab/youtube-audio";
import { createYoutubeJsAudioProvider } from "@echovisionlab/youtube-audio/youtube-js";

const service = createYoutubeAudioService({
  provider: createYoutubeJsAudioProvider(),
  sourceStore,
  makeSourceUrl: (id) => `/api/youtube-audio/${id}`,
});

See DISCLOSURE.md for access and use conditions.

createYoutubeJsAudioProvider() is exported separately so browser bundles do not accidentally pull the unofficial InnerTube client into application code. It rejects live/upcoming video and any source without a finite audio-only byte length. The adapter tries the VISIONOS and YTKIDS YouTube.js clients in order, accepting a source only after exact one-byte reads succeed at the beginning, middle, and end of the file. This keeps source preparation bounded for long public videos while rejecting URLs that resolve but later fail random access. Callers may override client when required. YouTube.js and the upstream private API can change independently; keep resolution failures observable and update this package rather than adding fallback scraping to the web application.

Each caller's wait for YouTube.js client creation, video metadata, and URL deciphering ends promptly when its AbortSignal is aborted; shared client creation continues for other callers. The pinned YouTube.js APIs do not accept an abort signal for Innertube.create(), getBasicInfo(), or decipher(), so aborting a caller does not stop the underlying library work.

The exported createMemoryYoutubeAudioSourceStore() is process-local. It prunes expired records during put, get, and delete operations; inject now when a deterministic clock is needed. It does not evict unexpired records, so use a shared store with an explicit capacity policy for long-lived multi-process services.

Development

corepack enable
pnpm install --frozen-lockfile
pnpm typecheck
pnpm test:coverage
pnpm build
pnpm package:verify
pnpm package:pack
YOUTUBE_VIDEO_ID=<authorized-video-id> pnpm smoke:youtube-range

Release

The initial package version requires an interactive npm publish with 2FA. Later versions publish directly from GitHub Actions using npm trusted publishing, with OIDC authentication and no manual approval step.

License

PolyForm Noncommercial 1.0.0. Commercial use requires a separate license from Echo Vision Lab. See LICENSE.md.