
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
@phuetz/lm-resizer
Advanced tools
Query-aware JSON compression for LLM agents, as a WebAssembly module: shrink noisy tool output before it reaches the model, keep errors and paths intact.
Query-aware compression of JSON tool output for LLM agents, as a WebAssembly module.
Coding agents (Claude Code, Codex, MCP servers, your own loops) spend most of their context window on
noisy tool output: huge JSON arrays, repeated schemas, logs. lm-resizer shrinks that text before it
reaches the model while keeping what matters, such as errors, file paths and the fields your query asks
for. This package is the WebAssembly build of the Rust core, usable from Node.js (≥ 18) or a browser.
The full toolbox (CLI wrapper around any command, HTTP proxy, MCP server, Claude Code / Codex hooks, test-runner filters) lives in the Rust binary: see the lm-resizer repository and its releases.
npm install @phuetz/lm-resizer
The package ships the compiled lm_resizer_wasm.wasm (about 2.6 MB); nothing to build.
import { initLmResizerWasmFromPackage } from "@phuetz/lm-resizer";
const lm = await initLmResizerWasmFromPackage();
const report = lm.compressJson(bigJsonString); // generic pipeline
const focused = lm.compressJson(bigJsonString, "error"); // keep what relates to "error"
console.log(report.bytes_saved, report.steps_applied);
console.log(report.output); // the compressed text to hand to the model
If you want to load the module yourself (browser, custom bundling), pass the bytes or a compiled
WebAssembly.Module:
import { initLmResizerWasm } from "@phuetz/lm-resizer";
const bytes = await fetch("/lm_resizer_wasm.wasm").then((r) => r.arrayBuffer());
const lm = await initLmResizerWasm(bytes);
initLmResizerWasmFromPackage(): Promise<LmResizerWasm> — Node.js only, loads the bundled wasm.initLmResizerWasm(input: WebAssembly.Module | BufferSource): Promise<LmResizerWasm>lm.compressJson(content: string, query?: string): CompressionReportCompressionReport fields: content_type, original_bytes, compressed_bytes, bytes_saved,
steps_applied (e.g. ["json_offload"]), cache_keys, output.
bytes_saved: 0 and an empty steps_applied; that is the honest answer, not an
error.git clone https://github.com/phuetz/lm-resizer && cd lm-resizer
rustup target add wasm32-unknown-unknown
./scripts/build-wasm.sh # writes packages/wasm/lm_resizer_wasm.wasm
node packages/wasm/smoke.mjs # real-execution smoke test
Apache-2.0. Source: https://github.com/phuetz/lm-resizer
FAQs
Query-aware JSON compression for LLM agents, as a WebAssembly module: shrink noisy tool output before it reaches the model, keep errors and paths intact.
The npm package @phuetz/lm-resizer receives a total of 15 weekly downloads. As such, @phuetz/lm-resizer popularity was classified as not popular.
We found that @phuetz/lm-resizer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.