amigo-labs

Native

Released

Rust-powered drop-in replacements for popular Node.js packages

A monorepo of npm packages under @amigo-labs, written in Rust and compiled to native addons via NAPI-RS, with prebuilt binaries for every major platform. Most packages also ship a WASM build for browsers and bundlers.

Platforms
Node.js · Browser
License
MIT
6platforms with prebuilt binaries
0transitive dependencies
≥ 22Node.js
NAPI-RS v3native runtime

Every call from Node.js into a native module pays a fixed cost for crossing the boundary, roughly 109 ns on modern Linux x64. The packages here are picked because their workload dwarfs that cost, and each one is benchmarked against its JavaScript alternative: the measured speedup decides whether a package stays, gets optimized, or is retired.

Native

Features

  • Drop-in API

    Each package is a drop-in replacement for a popular Node.js package. Where it is not a 100% drop-in, a MIGRATION.md says what differs.

  • Prebuilt native binaries

    Compiled with NAPI-RS for six targets: Linux x64 (glibc and musl), Linux ARM64, macOS x64 and ARM64, Windows x64. No build step on install, no compiler required.

  • WASM build for browsers

    Most packages ship a napi binary for Node.js and a WASM build for browsers and bundlers (Vite, esbuild, webpack ≥ 5, Rollup) in the same tarball. Conditional exports pick the right one; the import never changes.

  • Server-only where it matters

    argon2, jose and jwt stay Node-only on purpose — browser password hashing is an anti-pattern, and private signing keys must not ship to the browser.

  • Zero dependencies

    No transitive dependencies — installing a package pulls in the package and its platform binary, nothing else.

  • Measured, not claimed

    Every package is benchmarked against the best JavaScript alternative and checked against the upstream package's behavior with conformance tests. A perf review classifies each one Green, Yellow, Red or Black.

  • Published with provenance

    Releases are built in CI and published to npm with provenance, so every tarball can be traced back to the commit and workflow that built it.

Packages 36

Every package is a drop-in replacement for its npm counterpart.

crypto

search

  • BM2513× faster

    BM25 full-text search. Stateful NAPI class — build index once, query many times.

    @amigo-labs/bm25
  • fuse5–20× expected vs fuse.js

    Fuzzy text search index over JSON records, with weighted fields. SIMD-accelerated via nucleo-matcher.

    @amigo-labs/fuse
  • Minisearch1.2–51× faster

    Tiny in-memory full-text search with prefix autocomplete. Shares Rust search-core with @amigo-labs/bm25.

    @amigo-labs/minisearch

text

document

  • CSV1.49–1.88× faster

    CSV parsing and serialization via BurntSushi's csv crate.

    @amigo-labs/csv
  • jimpNative image-rs port

    Scoped jimp port: PNG/JPEG decode/encode + resize + crop + flip + rotate (90° multiples) + greyscale + brightness + contrast + composite, via image-rs.

    @amigo-labs/jimp
  • jpeg-jsPure-Rust decode/encode

    JPEG decode/encode to RGBA pixel buffers. Pure-Rust via jpeg-decoder + jpeg-encoder.

    @amigo-labs/jpeg-js
  • PDFTBD

    PDF generation — one FFI call per document. Labels / tickets / simple reports.

    @amigo-labs/pdf
  • PDF Parse15–41× slower

    PDF text + metadata extraction via pdf-extract/lopdf. No pdf.js, no browser pipeline.

    @amigo-labs/pdf-parse
  • pngjsPure-Rust DEFLATE

    PNG decode/encode to RGBA pixel buffers. Pure-Rust DEFLATE via flate2 + zlib-rs.

    @amigo-labs/pngjs
  • Svgo14–26× faster

    SVG optimizer via quick-xml. Ships the 8 highest-impact `preset-default` plugins.

    @amigo-labs/svgo
  • TypstTBD

    Typst document compiler — source in, PDF out. Bundled Libertinus fonts; offline-only packages.

    @amigo-labs/typst
  • XLSX2.6–3.3× faster

    XLSX read + write. Buffer in → rows out, rows in → Buffer out. Single-FFI-crossing.

    @amigo-labs/xlsx

util

graph

  • Force Layout3.6–7.2× faster

    Force-directed graph simulation. Batch-mode d3-force replacement for SSR / precompute workloads.

    @amigo-labs/force-layout
  • Graph Layout62–75× faster

    Hierarchical (Sugiyama-style) DAG layout. Single-call spec → positions + edge routing.

    @amigo-labs/graph-layout

archive

Install

Install

pnpm
pnpm add @amigo-labs/<name>

Replace <name> with a package from the list below.

npm
npm install @amigo-labs/<name>

View on GitHub

Features

  • enhance WASM performance measurement and visibility (4c129a7)
  • ship WASM bindings for all eligible crates (Angular/React support) (792802f)
  • typst: add WASM binding — 33/33 dual-target crates complete (381726e)

Bug Fixes

  • build: stop wasm-pack's pkg/.gitignore from emptying npm tarballs (6a70b18)
  • crates: regenerate index.js with current versions across 26 crates (69116f5)
  • typst: commit Cargo.toml dep + README that were missed last commit (bbb875d)

Documentation

  • full UI/UX pass on the showcase site (4aea272)
  • source category from each crate's amigo block (cbea23f)
  • specs: expansion-2026 dual-target plan (draft) (b30274f)

View on GitHub

Features

  • commonmark: add WASM binding + fix wasm-test failures (9de1610)
  • enhance WASM performance measurement and visibility (4c129a7)
  • graph-layout: add WASM binding via core split (b294905)
  • ship WASM bindings for all eligible crates (Angular/React support) (792802f)

Bug Fixes

  • build: stop wasm-pack's pkg/.gitignore from emptying npm tarballs (6a70b18)
  • crates: regenerate index.js with current versions across 26 crates (69116f5)

Documentation

  • full UI/UX pass on the showcase site (4aea272)
  • source category from each crate's amigo block (cbea23f)
  • specs: expansion-2026 dual-target plan (draft) (b30274f)