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

wow-blp-web

v0.7.2

Published

Decode and encode World of Warcraft BLP textures in the browser and Node.js (WebAssembly bindings for wow-blp)

Readme

wow-blp-web

npm

Decode and encode World of Warcraft BLP textures in the browser and Node.js — WebAssembly bindings for the wow-blp Rust crate. Everything happens in memory: bytes in (Uint8Array), pixels/bytes out.

Supports BLP1 (Warcraft III) and BLP2 (WoW) with all encodings: palettized (RAW1), uncompressed RGBA (RAW3), JPEG, and DXT1/3/5.

Getting the package

Install from npm (recommended for JS/TS):

npm install wow-blp-web

Or download wow-blp-web-<version>-web.tar.gz from the GitHub releases and unpack it (tar xzf ... creates ./pkg/), or build it yourself:

rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli

cargo build --release -p wow-blp-web --target wasm32-unknown-unknown
wasm-bindgen --target web --out-dir wrappers/wow-blp-web/pkg \
  target/wasm32-unknown-unknown/release/wow_blp_web.wasm

Usage

import init, { decodeBlp, encodeBlp, blpToPng, pngToBlp } from "wow-blp-web";
// If you downloaded the tarball or built locally, use:
// import init, { decodeBlp, encodeBlp, blpToPng, pngToBlp } from "./pkg/wow_blp_web.js";
await init();

// Decode: metadata + RGBA pixels of one mipmap level (default 0)
const tex = decodeBlp(new Uint8Array(await file.arrayBuffer()));
// {
//   width, height,
//   rgba: Uint8Array,          // width * height * 4 RGBA bytes
//   mipmaps: [{level, width, height, data_size}, ...],
//   version: "blp1" | "blp2",
//   compression: "jpeg" | "raw1" | "raw3" | "dxt1" | "dxt3" | "dxt5",
//   alphaBits: 0 | 1 | 4 | 8,
// }
const mip2 = decodeBlp(bytes, 2);             // optional mipmap level

// Encode: raw RGBA pixels -> BLP bytes
const blp = encodeBlp(tex.rgba, tex.width, tex.height, {
  version: "blp2",        // "blp1" | "blp2"          (default "blp2")
  format: "dxt5",         // see below               (default "dxt5" for blp2, "jpeg" for blp1)
  alphaBits: 8,           // 0|1|4|8, "raw1" only    (default 8)
  hasAlpha: true,         // jpeg/dxt* only          (default true)
  quality: "balanced",    // "fast"|"balanced"|"best", DXTn only (default "balanced")
  mipmaps: true,          // generate mipmaps        (default true)
  filter: "triangle",     // mipmap filter: "nearest"|"triangle"|"catmullRom"|"gaussian"|"lanczos3"
});

// PNG convenience helpers (input can be PNG, JPEG, BMP, TGA, ...)
const png = blpToPng(bytes);                  // BLP -> PNG bytes
const back = pngToBlp(png, { format: "dxt1" }); // image -> BLP bytes

Format availability: "raw1" and "jpeg" work for both versions; "raw3", "dxt1", "dxt3", "dxt5" are BLP2 only.

Limitation: BLP0 files with external mipmap files (Warcraft III RoC beta) cannot be decoded by this in-memory API. BLP1/BLP2 always embed their mipmaps, so this rarely matters in practice.