Back to browse
GitHub Repository

Fast, Complete NumPy for TypeScript & JavaScript

351 starsTypeScript

NumPy for Browser, Node.js, Deno and Bun

by dupontcyborg·Feb 25, 2026·2 points·0 comments

AI Analysis

●●●BangerWizardryZero to OneShip It

NumPy's full API in JavaScript with zero dependencies, 93% coverage validated against Python.

Strengths
  • 94% API coverage (476/507 functions) with 6,000+ cross-validated tests against NumPy—eliminates guesswork about correctness.
  • Zero dependencies, 93 KB minified+gzipped, fully tree-shakeable—genuinely portable across Node/browser/Deno/Bun without bloat.
  • .npy/.npz read/write compatibility—actual interop with Python ML workflows, not just syntax mimicry.
Weaknesses
  • 15x slower than NumPy in TypeScript (acknowledged; WASM optimization planned but not shipped).
  • JavaScript numerics hit a ceiling—pure TS will never match Python's C-backed performance for serious ML workloads.
Target Audience

JavaScript/TypeScript developers needing numerical computing in browsers, Node.js, Deno, or Bun environments

Similar To

NumJS · TensorFlow.js · Danfo.js

Post Description

I've been spending some time on a side project, `numpy-ts`, which is a TypeScript numerical library inspired by NumPy. It aims to bring the same NumPy API (where possible) to Node.js/Browser/Deno/Bun with full .npy/.npz compatibility (read & write).

It currently has 476 of NumPy's 507 functions implemented, all cross-validated against NumPy with >6,000 validation tests. The lib is about 93 kB minified+gzipped and has zero dependencies, and it's fully tree-shakeable.

Since it's written in TypeScript, it's on average 15x slower than NumPy. I just tagged 1.0.0, and will begin performance optimization soon (both algorithmic and selective WASM for fused kernels).

You can try it in your browser here: https://numpyts.dev/playground

Disclaimer that this was a mix of hand-written code (API, deterministic tooling) and AI-assisted (functional implementations, validation test implementations).

Similar Projects

Developer Tools●●Solid

Isol8 – An isolated environment for AI agents to execute code

This is a practical, engineer-first sandbox that feels built for LLM workflows: five runtimes (Python/Node/Bun/Deno/Bash), streaming SSE output, warm container pools for sub-100ms latency, and security defaults like read-only rootfs, seccomp, and resource caps. The embeddable TypeScript API plus an agent 'skill' and on-the-fly package installs make it easy to plug into agent pipelines. My nitpick: it still depends on Docker as the trust boundary — I'd like clearer hardened defaults, policy/audit primitives, and documentation about residual host risks before using it to run fully hostile code.

WizardryNiche Gem
masterbruce10
103mo ago