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

@camp-dev/shaders-cli

v0.22.0

Published

Dev-time CLI for Shaders. Renders a component tree to a poster image with the poster command.

Downloads

631

Readme

@camp-dev/shaders-cli

Dev-time CLI for Shaders. It has one command, poster, which renders a Shaders component tree to a static image so <ShaderPoster> has something to show while WebGPU starts up.

Components themselves ship in @camp-dev/shaders. Nothing here copies files into your project.

Install

pnpm add -D @camp-dev/shaders-cli playwright
pnpm exec playwright install chromium

Requires Node 22 or later. Playwright is an optional peer dependency: the CLI drives the copy your project installs, so the poster renders with the same package versions your app uses.

Render a poster

npx shaders-cli poster --source ./src/hero.tsx --output ./public/hero.jpg

The source file's chosen export must render the whole tree, including <ShaderScene>. The CLI bundles that file with esbuild against your project's node_modules, serves it to headless Chromium, waits for the first frame with content, and writes the screenshot. The animation clock is pinned to zero, so the same source produces the same image every run.

| Flag | Default | What it does | | --------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------ | | --source <file> | required | A .tsx or .ts file whose export renders the full tree. | | --output <path> | required | Where to write the image. The extension is optional; --format decides it. Parent directories are created. | | --format <format> | jpg | png or jpg. | | --quality <n> | 80 | JPEG quality from 1 to 100. Ignored for PNG. | | --export-name <name> | default | Which export of the source file to render. | | --capture-delay <seconds> | 0 | How long to wait after the first frame with content before capturing. | | --width <px> | 1280 | Render width, up to 4096. | | --height <px> | 720 | Render height, up to 4096. | | --device-scale-factor <n> | 2 | Capture device pixel ratio. The default matches the live renderer's cap, so posters stay crisp on retina displays. | | --background <color> | none | A CSS color composited behind the shader before capture. Use it for shaders with a transparent base layer. |

If no frame with content arrives within 10 seconds, the command fails with an error rather than writing a blank image.

Pick a format

The default, JPEG at quality 80, suits most shaders. PNG wins on shaders with large flat regions, where lossless compression beats JPEG.

| Use --format png for | Use the default JPEG for | | -------------------------------------- | ------------------------------------ | | LinearGradient with hard stops | Aurora and other gradient-heavy scenes | | SimplexNoise with contour bands | MeshGradient | | Anything with fewer than about 20 colors | Grain and other high-entropy noise |

If you are unsure, render both. The size difference runs several times in either direction.

Wire it up

The command prints the <ShaderPoster> wrapper when it finishes, with the path filled in. Add the imports and it is ready to use:

import { ShaderScene, LinearGradient } from '@camp-dev/shaders';
import { ShaderPoster } from '@camp-dev/shaders/poster';

<ShaderPoster poster={<img src="/hero.jpg" alt="" style={{ width: '100%', height: '100%', objectFit: 'cover' }} />}>
  <ShaderScene>
    <LinearGradient />
  </ShaderScene>
</ShaderPoster>

@camp-dev/shaders/poster imports no three.js, so a server-rendered page can put the poster in its initial HTML while the scene loads behind a dynamic import.

Limitations

  • The source export has to render the entire tree. The CLI does not wrap it in <ShaderScene> for you.
  • Components that read app context, such as a theme or router hook, do not render in the headless harness. Extract a presentational child and point --source at that.
  • WebP and AVIF output are not supported.

Docs

https://github.com/campdotdev/shaders

License

MIT. See LICENSE.