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

@azohra/meteo.j2k

v0.2.0

Published

A pure-TypeScript ITU-T T.800 JPEG 2000 decoder scoped to the codestream subset ECCC's GRIB2 feeds ship: single tile, single grayscale component, reversible 5/3 wavelet, single quality layer, default precincts, MQ-coded EBCOT. Anything outside that subset

Readme

@azohra/meteo.j2k

A JPEG 2000 (ITU-T T.800) decoder in pure TypeScript, scoped to exactly the codestream subset ECCC's GRIB2 feeds ship, justified by explainability: every marker, MQ context, and lifting step lives in ten small modules with its clause of T.800 named. It is the production codec behind @azohra/meteo.grib/j2k-node, and owning the internals pays twice: decodeJ2kRegion decodes only the codeblocks a few requested gridpoints touch (bit-identical to the full decode at those points, ~16× faster per core on the largest ECCC field), and the worker pool fans one field's independent EBCOT codeblocks across threads for full decodes. Benchmarks, with dates and method: https://meteo.azohra.com/docs/j2k/performance/. Zero runtime dependencies, no Node APIs in src/.

pnpm add @azohra/meteo.j2k

Decode a real field

The workspace's golden corpus carries real ECCC messages; the codestream is the GRIB section 7 payload (DRT 5.40). This decodes one and reads a sample:

// decode-fixture.mjs — run inside j2k/ after `pnpm build` (and a grib build)
import { readFileSync } from "node:fs";
import { parseFields, splitMessages } from "../grib/dist/index.js";
import { decodeJ2k } from "./dist/index.js";

const bytes = readFileSync("../grib/test/fixtures/geps-orog-m00.grib2");
const [field] = parseFields(splitMessages(bytes)[0]);
const codestream = field.section7.subarray(5); // DRT 5.40: raw J2K after the section header

const { values, width, height, bitsPerSample, isSigned } = decodeJ2k(codestream);
console.log(`${width}x${height} = ${values.length} samples, ${bitsPerSample}-bit ${isSigned ? "signed" : "unsigned"}`);
console.log(`first samples: ${Array.from(values.slice(0, 4)).join(", ")}`);
720x361 = 259920 samples, 12-bit unsigned
first samples: 1166, 1166, 1166, 1166

When only a few gridpoints matter, decodeJ2kRegion(codestream, indices) returns the same integers decodeJ2k would put at those raster indexes while entropy-decoding only the codeblocks the points touch.

The decoder covers the measured subset the feeds ship and nothing more (everything outside it fails loudly with a named UnsupportedJ2kError); how every configuration is accepted — including region decode's exactness contract — is at https://meteo.azohra.com/docs/j2k/correctness/.

Documentation

The reference lives in docs/ (the subset, the two-ring correctness gate, and the measured performance each have a page) and is served at https://meteo.azohra.com/docs/j2k/.

MIT © Justin Watts