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

@hevcjs/core

v1.2.1

Published

HEVC/H.265 video decoder for the browser using WebAssembly — decode HEVC streams directly in JavaScript with MSE support

Readme

@hevcjs/core

HEVC/H.265 decoder compiled to WebAssembly, with a built-in HEVC-to-H.264 transcoding pipeline. 236KB WASM, zero dependencies.

Implemented per ITU-T H.265 v8 — 716 pages of spec, validated pixel-perfect against ffmpeg on 128 test bitstreams.

Install

npm install @hevcjs/core

Setup

The package includes 3 static files that must be served by your web server:

  • transcode-worker.js — Web Worker (IIFE, standalone)
  • wasm/hevc-decode.js — Emscripten glue code
  • wasm/hevc-decode.wasm — WASM binary (236KB)

Copy them from node_modules/@hevcjs/core/dist/ to your public/static directory:

cp node_modules/@hevcjs/core/dist/transcode-worker.js public/
cp node_modules/@hevcjs/core/dist/wasm/hevc-decode.js public/
cp node_modules/@hevcjs/core/dist/wasm/hevc-decode.wasm public/

Adjust the destination to match your project structure (public/, static/, dist/, etc.).

Usage

MSE intercept (transparent HEVC playback)

import { installMSEIntercept } from '@hevcjs/core';

installMSEIntercept({
  workerUrl: '/transcode-worker.js',
  wasmUrl: '/hevc-decode.js',
});

Loading from a CDN (zero build, cross-origin)

@hevcjs/core works directly from a CDN — no install, no build step, no static asset copy:

<script type="module">
  import { installMSEIntercept } from 'https://esm.sh/@hevcjs/core@1';

  installMSEIntercept({
    workerUrl:     'https://unpkg.com/@hevcjs/core@1/dist/transcode-worker.js',
    wasmUrl:       'https://unpkg.com/@hevcjs/core@1/dist/wasm/hevc-decode.js',
    wasmBinaryUrl: 'https://unpkg.com/@hevcjs/core@1/dist/wasm/hevc-decode.wasm',
  });
</script>

wasmBinaryUrl is required when assets live on a different origin than the page (Emscripten otherwise fails to resolve the .wasm relative to the worker's blob: URL). Cross-origin worker loading is handled transparently — the plugin fetches the script and wraps it in a same-origin blob URL since classic Workers refuse cross-origin scripts even with CORS headers.

Segment transcoder (manual control)

import { SegmentTranscoder } from '@hevcjs/core';

const transcoder = new SegmentTranscoder({ fps: 25 });
await transcoder.init();
await transcoder.processInitSegment(initSegmentBytes);
const h264Segment = await transcoder.processMediaSegment(hevcSegmentBytes);

How it works

  1. Demux — mp4box.js extracts raw HEVC NAL units from fMP4 segments
  2. Decode — WASM decoder produces YUV frames (spec-compliant, pixel-perfect)
  3. Encode — WebCodecs VideoEncoder compresses to H.264
  4. Mux — Custom fMP4 muxer wraps H.264 in ISO BMFF with correct timestamps

All heavy work runs in a Web Worker. No SharedArrayBuffer required, no special server headers needed.

Performance

Single-threaded, Apple Silicon:

| Resolution | WASM (Chrome) | |---|---| | 1080p decode | 61 fps | | 4K decode | 21 fps | | 1080p transcode | ~2.5x realtime |

Requirements

  • WebAssembly + Web Workers
  • WebCodecs (Chrome/Edge 94+, Firefox with H.264 encoding support) for transcoding
  • Secure Context (HTTPS or localhost)

License

MIT