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

@shader-gallery/runtime

v0.1.0

Published

Framework-free WebGL runtime (createShaderTile) and colour themes for shader.gallery backgrounds.

Readme

@shader-gallery/runtime

The framework-free WebGL runtime and colour themes that power every tile on shader.gallery, the evolve/mashup tools, the poster pipeline, and external embeds. This is the single shared core; the React, Vue and Svelte components and the web component are all thin shells over it.

npm install @shader-gallery/runtime

Mount a background by slug

The simplest path fetches a shader from the CDN and drives a full-bleed canvas:

import { mountBackground } from '@shader-gallery/runtime';

const handle = mountBackground(document.querySelector('#bg'), {
  slug: 'nacre',
  palette: 'witchlight',
});

// later
handle.setPalette('ember');
handle.destroy();

Shaders are fetched by slug at runtime, so your bundle stays tiny and the catalog can update without a package release. Point base at http://localhost:…/ or a Cloudflare tunnel to develop against local data.

Drive a tile directly

When you already have the fragment source (bundled/offline, or the ?raw embed path), skip the fetch:

import { createShaderTile } from '@shader-gallery/runtime';

const tile = createShaderTile(canvas, fragSource, {
  palette: 'midnight',
  uniforms: { u_glow: 1.4 },
  post: { bloom: 1.2 },
});

tile.setPalette('glacier');   // retarget live, no context rebuild
tile.setUniforms({ u_glow: 0.8 });
tile.destroy();

Exports

| Export | What it is | |---|---| | createShaderTile(canvas, frag, opts) | Core renderer: two-pass FBO pipeline (shader → post-FX → canvas), live palette/uniform/post setters, offscreen RAF pause. | | mountBackground(target, opts) | Fetch-by-slug convenience over createShaderTile; manages the canvas + lifecycle. | | loadShader(slug, opts) | Fetch a shader's meta.json + shader.frag from the CDN. | | setDefaultBase(base) | Override the CDN origin shaders are fetched from. | | resolvePalette(palette, meta) | Resolve a theme name (or a shader's default) to its vec3[4]. | | THEMES, THEME_NAMES | The colour-theme map and its names. | | themeNamesFor, palettesFor, defaultThemeName | Per-shader theme resolvers. | | POST_DEFAULTS, POST_PRESETS, POST_FRAGMENT_SRC, resolvePost | The shared post-processing layer (chromatic aberration → tone → vignette → grain). | | createMashTile, BLEND_MODES, BLEND_IDS | Multi-layer blend tile used by the mashup tool. |

Submodules are also importable directly: @shader-gallery/runtime/renderer.js, /palettes.js, /mount.js, /web-component.js.

All exports are pure functions with no import-time side effects (the web component's registration side effect lives only in ./web-component.js), so the barrel stays tree-shakeable and SSR-safe.

MIT © E. T. Carter · shader.gallery · [email protected]