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

wtc-simplegl

v1.1.0

Published

A small WebGL2 helper library that cuts down boilerplate, usable from npm or as a single copy-paste file.

Readme

wtc-simplegl

A small WebGL2 helper library. It takes care of the boilerplate (compiling and linking shaders, vertex arrays, uniforms, textures, framebuffers, canvas sizing, cleaning up) and otherwise stays out of the way: you still write GLSL and plain gl calls.

It's built to work where you can't install packages. The whole library is one file you can copy into a project.

Documentation: guides, a cookbook of live examples, and the API reference.

WebGL2 only: every function expects a context from canvas.getContext("webgl2").

Getting it

Copy-paste: download simplegl.js from the latest release, or from a CDN:

https://cdn.jsdelivr.net/npm/wtc-simplegl/dist/simplegl.js
https://unpkg.com/wtc-simplegl/dist/simplegl.js

Then import from it as an ES module:

<script type="module">
  import { createContext, createRenderer, loop } from "./simplegl.js";
</script>

npm:

npm install wtc-simplegl
import { createContext, createRenderer, loop } from "wtc-simplegl";

Quick start

A full-window canvas with an animated fragment shader:

import { createContext, createRenderer, loop } from "./simplegl.js";

const gl = createContext();

const quad = createRenderer(gl, {
  vert: `#version 300 es
in vec2 a_position;
void main() { gl_Position = vec4(a_position, 0, 1); }`,
  frag: `#version 300 es
precision highp float;
uniform vec2 u_resolution;
uniform float u_time;
out vec4 colour;
void main() {
  vec2 uv = gl_FragCoord.xy / u_resolution;
  colour = vec4(uv, 0.5 + 0.5 * sin(u_time), 1);
}`,
  attributes: {
    // One triangle that covers the screen
    a_position: { data: new Float32Array([-1, -1, 3, -1, -1, 3]), size: 2 },
  },
  count: 3,
});

loop((time) => {
  quad.bindVAOs();
  quad.setUniforms({ u_resolution: [gl.canvas.width, gl.canvas.height], u_time: time });
  quad.render();
});

Your first shader walks through it.

What's in it

  • createContext and loop: a WebGL2 context that keeps the canvas sized to the page, and a frame loop.
  • createRenderer: a program, its vertex array and uniforms, with setUniforms for numbers, arrays and textures alike.
  • createTexture, loadTexture, updateTexture: textures from images, canvases, video and typed arrays.
  • createFrameBuffer: framebuffers, ping-pong pairs, float targets and depth.
  • Transform feedback, for simulating on the GPU and drawing the results with another renderer.
  • delete() and AbortSignal support throughout, for React and other places effects come and go.

Development

lib/ holds the source, one function per file. npm run build joins it into dist/simplegl.js; the build runs automatically when the package is packed, so dist/ isn't committed.

The documentation is in docs/, with its own package.json. Run npm ci --prefix docs once, then npm run docs:dev. docs/README.md covers writing pages, live examples and the JSDoc the API reference needs.

Releases use Changesets. Add a changeset with npx changeset in any PR that changes lib/. Merging to main opens a "Version Packages" PR, and merging that publishes to npm and attaches simplegl.js to the GitHub release.