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

gifsicle-wasm

v1.96.4

Published

gifsicle compiled to WebAssembly — optimize GIFs in the browser

Readme

gifsicle-wasm

npm License: GPL v2

gifsicle compiled to WebAssembly with Emscripten. Optimize GIFs entirely in the browser.

Built from a version-controlled submodule of the original gifsicle source in public CI. Also available as a Python wheel for native use.

Install

npm install gifsicle-wasm

Usage

The WASM module exposes gifsicle's CLI entry point (_run_gifsicle(argc, argv)) — you pass command-line arguments, same as invoking the gifsicle binary.

import createGifsicle from "gifsicle-wasm";

const mod = await createGifsicle();

// Write input GIF to Emscripten virtual filesystem
mod.FS.writeFile("/input.gif", new Uint8Array(gifBuffer));

// Build argv
const args = ["gifsicle", "-O2", "--lossy=80", "-o", "/output.gif", "/input.gif"];
const argv = mod._malloc((args.length + 1) * 4);
const ptrs = [];
for (let i = 0; i < args.length; i++) {
  const p = mod.stringToNewUTF8(args[i]);
  ptrs.push(p);
  mod.setValue(argv + i * 4, p, "i32");
}
mod.setValue(argv + args.length * 4, 0, "i32");

// Run gifsicle
mod._run_gifsicle(args.length, argv);

// Clean up
ptrs.forEach((p) => mod._free(p));
mod._free(argv);

// Read output
const output = mod.FS.readFile("/output.gif");

For a complete working example including error handling and Web Worker isolation, see gifsicle-worker.js in the agent-log-gif project.

Node.js

Works in Node.js too — pass wasmBinary to avoid fetch:

import { readFileSync } from "fs";
import createGifsicle from "gifsicle-wasm";

const wasmBinary = readFileSync("node_modules/gifsicle-wasm/dist/gifsicle.wasm");
const mod = await createGifsicle({ wasmBinary });

Building WASM locally

Requires Emscripten, autoconf, and automake.

bash build.sh
# Output: dist/gifsicle.js + dist/gifsicle.wasm

# Smoke test (requires Node.js)
node test_wasm.mjs

How is this different from gifsicle-wasm-browser?

Provenance: gifsicle-bin's WASM is built from a version-controlled submodule of the original gifsicle source in public CI.

Invocation model: gifsicle-bin's WASM exposes the raw _run_gifsicle(argc, argv) gifsicle CLI entry point instead of wrapping as a library. See License for more on why we do that.

Credits

gifsicle by Eddie Kohler. WASM build approach based on Simon Willison's work.

License

GPL-2.0-only. See LICENSE.

The WASM module only provides the same command-line-argument interface as the gifsicle binary, and can be run isolated in a separate browser worker. See the FSF's Plugins and Proprietary Systems FAQs.