JS/TS Libraries of the Week: Bloomberg's Stricli CLI, binary-parser 3.0, WASM-Free ImageScript 4.0, and Faster Flatbush 4.9Thematic roundup · digest for November 27
Isometric assembly of modules for Bloomberg Stricli, binary-parser, ImageScript, and Flatbush
Thematic roundup4 sections≈ 6 min

JS/TS Libraries of the Week: Bloomberg's Stricli CLI, binary-parser 3.0, WASM-Free ImageScript 4.0, and Faster Flatbush 4.9

Running --help on a 50-command CLI opens instantly, an edge function re-encodes images to AVIF without C++ binaries, and a million rectangles pack into a 2D index in 44 ms. All of that runs in plain JS/TS with no heavy native glue when you swap bloated toolkits for four focused libraries.

Stricli by Bloomberg: Type-Safe CLIs With Lazy Loading

Node.js CLIs share a classic flaw: with three commands, commander or yargs feel instant. Grow to dozens of subcommands, and every --help call loads cloud SDKs and parsers into memory, making you wait seconds just to see flags.

Bloomberg open-sourced Stricli (@stricli/core) in 2024, and in November 2026 refreshed its documentation with a Live Playground plus llms.txt / llms-full.txt for AI agents. It has zero dependencies and runs on Node.js, Bun, and other JS runtimes.

Command definitions live separately from implementation, and logic loads lazily via import() inside loader. Until a command runs, its modules never touch disk.

import { buildCommand } from "@stricli/core";

export const deployCmd = buildCommand({
  // Command code loads only when invoked
  loader: async () => import("./deploy-impl"),
  parameters: {
    flags: {
      // Enum gives TS types, validation, and --help text at once
      env: {
        kind: "enum",
        values: ["stage", "prod"],
        brief: "Target environment",
      },
    },
  },
  docs: { brief: "Deploy service to the selected environment" },
});

From one definition, Stricli infers TypeScript types (including enums and variadic arrays), validates input, and builds help and error output. Unlike oclif, you don't need a plugin architecture just to get started.

binary-parser 3.0: Declarative Binary Parsing

Parsing TCP, ELF, or tar headers by hand with DataView is an easy way to be off by two bytes. With binary-parser 3.0, you chain method calls to describe a format, and the library compiles a parser that runs as fast as hand-written code.

Version 3.0 goes ESM-only with no CJS build, raising the minimum from Node.js 14 to 22.12 (ES2022, where require(esm) also works). It adds skipBits() to skip bits without storing fields and allows length 0 for string, buffer, wrapped, and array.

import { Parser } from "binary-parser";

const ipHeader = new Parser()
  // Set byte order and read IPv4 fields bit by bit
  .endianness("big")
  .bit4("version")
  .bit4("headerLength")
  .uint8("tos")
  .uint16("packetLength")
  // New in v3.0: skip 16 bits without writing to the object
  .skipBits(16)
  .array("src", { type: "uint8", length: 4 });

const parsed = ipHeader.parse(buf);

Validation is tighter too: an array with readUntil: "eof" on an empty element throws instead of hanging in an infinite loop. Errors also catch __proto__ keys, missing varName in choice(), and invalid encodings (checked via TextDecoder at compile time). Following GHSA-xmxc-6c22-m377 since 2.3.1, length and offset only accept field names. Node 20 users should stay on 2.3.1.

ImageScript 4.0: WebP, AVIF, and JPEG XL in Pure TypeScript Without WASM

Image processing in JS often feels like a compromise: native sharp (libvips) is fast yet won't run in browsers or edge workers, while pure Jimp 2 lacks modern formats. ImageScript 4.0 is pure TypeScript with zero WASM or C++ addons, runs in Node.js >= 22.13, Deno, Bun, browsers, and edge runtimes, and reads/writes WebP, AVIF, and JPEG XL (heavy codecs can parallelize via threads).

Version 4.0 moves every method from positional arguments to a single options object and replaces numeric mode constants with strings.

import { Image } from "imagescript";
import { readFile, writeFile } from "node:fs/promises";

// In 4.0, options are passed as an object
const img = await Image.decode(await readFile("input.jpg"));
img.resize({ width: 256, mode: "bicubic" });

const webp = await img.encodeWEBP({ quality: 85 });
await writeFile("out.webp", webp);

Compatibility with 3.x breaks in several places: the GIF class is gone (decode() returns Animation, Image.decode() returns the first frame), Animation stores frames in frames instead of extending Array, rotate() turns clockwise, WebP at quality: 100 is lossless, and quantize() enables dithering by default. Protection against malformed files is stronger too. Per the migration guide, upgrade to 3.20.5 first, clear deprecation warnings, then move to 4.0.

Flatbush 4.9: A 2D Spatial Index Up to 2.7x Faster

Finding objects inside a viewport or locating nearest neighbors by scanning an array gets painful fast. Vladimir Agafonkin's Flatbush uses a packed Hilbert R-tree stored in one flat ArrayBuffer, which transfers to a Web Worker via postMessage(index.data, [index.data]) with zero copying.

Releases 4.8.0 and 4.9.0 switched to radix sort. Indexing 1 million rectangles dropped from 105 ms to 44 ms, and 100k rectangles fell from 9.1 ms to 3.4 ms (1.7–2.7x faster from 8,192 items up, plus up to 1.9x more in 4.9 on 2k–100k items). neighbors() dropped from 30.5 ms to 22.7 ms across 10k queries on a million items, with another 7–18% shaved off in 4.9.

import Flatbush from "flatbush";

// The entire index lives in a single ArrayBuffer
const index = new Flatbush(items.length);
for (const p of items) {
  index.add(p.minX, p.minY, p.maxX, p.maxY);
}
index.finish();

// Bounding-box search and 5 nearest neighbors to (x, y)
const hitIds = index.search(minX, minY, maxX, maxY);
const nearest = index.neighbors(x, y, 5);

Version 4.8 added index.trim(), and 4.9 inlined flatqueue to hit zero dependencies. Both finish() and Flatbush.from() now throw immediately on NaN coordinates instead of silently corrupting searches. The main limit stays unchanged: the index is static and can't be mutated after finish() without rebuilding (use RBush for dynamic data).

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 5