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

@clypra-studio/native-render-wasm

v0.1.2

Published

In-browser WebAssembly compositor for Clypra Studio — CDN-streamed wgpu render core

Downloads

362

Readme

@clypra-studio/native-render-wasm

In-browser WebAssembly compositor for Clypra Studio — running the high-performance native wgpu render core directly in the browser.

Features

  • Native wgpu in Browser: Runs the same compositing, rasterization, and effect shaders compiled directly from Rust.
  • Zero Binary Bloat: The npm package stays ultralight (~60 kB compressed). The 12 MB .wasm binary is streamed at runtime from Cloudflare R2 via WebAssembly.instantiateStreaming.
  • Full TypeScript Support: Complete type definitions for frame requests, project snapshots, color grading, raster/video layers, and GPU handshakes.
  • Configurable CDN Endpoint: Default global CDN distribution with support for local or self-hosted .wasm asset overrides.

Installation

pnpm add @clypra-studio/native-render-wasm
# or
npm install @clypra-studio/native-render-wasm

Quick Start

1. Probe the Renderer

Check if the WebAssembly and WebGPU/WebGL render backend is ready:

import { probeNativeRenderer } from "@clypra-studio/native-render-wasm";

const handshake = await probeNativeRenderer();
console.log("Renderer ready:", handshake.gpu.state); // "ready"
console.log("GPU Adapter:", handshake.gpu.adapterName);

2. Render a Frame

Render a multi-layer project snapshot to an image Blob:

import { renderFrame, type NativeLabFrameRequest } from "@clypra-studio/native-render-wasm";

const request: NativeLabFrameRequest = {
  contractVersion: 1,
  requestId: "frame-001",
  frameTime: {
    frameIndex: 0,
    ticks: 0,
    timescale: 60,
  },
  outputWidth: 1920,
  outputHeight: 1080,
  quality: "full",
  colorPolicy: {
    version: 1,
    workingSpace: "srgb",
    outputFormat: "rgba8Srgb",
    toneMapHdrToSdr: true,
    displayProfile: "srgb-reference",
  },
  renderGraphVersion: 1,
  project: {
    schemaVersion: 1,
    projectRevision: "rev-1",
    canvasWidth: 1920,
    canvasHeight: 1080,
    clearColor: [0, 0, 0, 1],
    videoLayers: [],
    rasterLayers: [
      {
        assetId: "overlay-1",
        width: 1920,
        height: 1080,
        x: 0,
        y: 0,
        rotation: 0,
        opacity: 1,
        zIndex: 0,
        blendMode: "normal",
      },
    ],
  },
};

const result = await renderFrame(request);
console.log("Generated image blob:", result.image, result.contentType); // Blob { type: 'image/png' }

3. Custom WASM Endpoint (Optional)

By default, the renderer loads the official precompiled binary from Cloudflare R2: https://clypra-worker-api.abdulkabirmusa.com/media/wasm/clypra_render_wasm_bg.wasm

To use a custom host or a locally hosted development build:

import { configureWasmRenderer } from "@clypra-studio/native-render-wasm";

configureWasmRenderer({
  wasmUrl: "https://your-custom-cdn.com/wasm/clypra_render_wasm_bg.wasm",
});

API Reference

Functions

  • probeNativeRenderer(signal?: AbortSignal): Promise<NativeLabHandshake>: Probes and initializes the WASM instance, returning adapter and GPU status.
  • renderFrame(request: NativeLabFrameRequest, signal?: AbortSignal): Promise<NativeLabFrameResult>: Compiles and executes the render graph for a single frame, returning a PNG Blob.
  • isRendererReady(): boolean: Synchronously checks if the WASM singleton is initialized.
  • configureWasmRenderer(options: { wasmUrl?: string }): void: Configures the remote or local WASM binary URL.

Classes & Errors

  • ClypraWasmError: Extends standard Error with cause tracking (error.cause), thrown on network download failures, WebAssembly initialization issues, or shader render failures.

Constants

  • DEFAULT_CLYPRA_WASM_URL: The default Cloudflare R2 CDN URL for the compiled .wasm binary.

License

MIT © AIEraDev