Skip to content

Node.js / TypeScript

N-API addon with TypeScript bindings. ESM-only, targets ES2022. Prebuilt binaries are published for macOS (x64/arm64), Linux (x64/arm64), and Windows (x64); cmake-js falls back to a source build where prebuilds aren't available.

At a glance

import { read, getVersion } from "mscompress";

console.log(getVersion());

const f = read("data.mzML");
for (const s of f.spectra) {
  console.log(s.scan, s.msLevel, s.mz.length);
}

f.arguments.threads = 8;
f.arguments.zstdCompressionLevel = 9;
f.compress("data.msz");
f.close();