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

qoi-wasm

v2.0.0

Published

A QOI decoder written in WebAssembly

Readme

QOI WASM

A QOI decoder written in the WebAssembly Text Format (WAT). Current size of the library is 549 bytes.

WAT

An implemention of the QOI decoder. This implementation is dependent on that the host can handle Multi-Value Wasm. Included is a compiled WAT to WASM file that can be instantiated to decode images. Demo is deployed here. (Note the requirements for the browser noted below.)

Usage

The wasm module assumes that the QOI data, including the header, is stored at memory index 0 before decompression. To decompress the data call the d method, e.g.,

const header = wasm.instance.exports.d();
const [width, height, channels, colorspace, memoryOffset] = header;

Where the width will be greater than zero if the data is a valid QOI. The memoryOffsets names the index where the decompressed data starts in the now expanded memory area.

Memory layout for decompressing

Example

In the viewer folder is an example on how to use the module. To view the example you need a browser that supports the File API, works on Chrome at the moment, does not work on Safari. There are two .qoi files in the assets folder that can be used as test input. To run the example locally

node serve.mjs

and point your compatible browser to QOI Viewer

Compiling

To compile the project, install the dependencies and run the compile script

npm i

npm run compile

The ouput is the decoder file called qoi.wasm.

Inline

Memory layout for decompressing

Another option is to inline the decompressor and the image data into a WASM module. After the module is loaded the instance exports a method called d (for decompress) and the memory (m) where the result will be after decompression. See below for memory layout, main difference here is that the decompressed data is stored at location 0.

Memory layout for decompressing

Usage

npm run kombine file.qoi

If all goes well a new file will be written in the same folder as the src QOI file.

Example

To see a runtime example running locally

npm run serve

and go to kombiner

To try the compilation step

npm run kombine ./assets/pixil-frame-0.qoi

and the compiled files will be stored in the assets folder.

Some example results. (sizes in bytes)


File                    PNG         QOI         QOI-WASM    QOI-WASM-BROTLI
pixil-frame-o           124         104         530         308
peerfeer_frame_rgba     1684359     1747735     1748180     1019378
dice                    349827      519653      520096      318018
kodim10                 593463      652383      652820      499621
kodim23                 557596      675251      675688      512840
qoi_logo                16605       16488       16925       7968
testcard_rgba           14227       24167       24605       9133
testcard                18371       21857       22295       7360
wikipedia_008           1344960     1521134     1521571     1225351

First two images are included in this repository, the rest comes from the official QOI page.

Dependencies

The WebAssembly Binary Toolkit for compiling the WAT files to WASM.

Brotli for compressing the inlined decompression module.