Complete NumPy for TypeScript
The most comprehensive NumPy implementation for TypeScript and JavaScript. Write numerical computing code with the same API you already know from Python — fully type-safe, tree-shakeable, and validated against NumPy itself.- npm
- yarn
- pnpm
Why numpy-ts?
94% API Coverage
476 of 507 NumPy functions implemented. From basic arithmetic to FFT, linear algebra, random distributions, and beyond.
Faster than NumPy
1.13x faster than NumPy on average across 7,200 benchmarks. Faster in 12 of 18 categories, across all array sizes and dtypes.
Zero Dependencies
No native modules, no third-party packages. Pure TypeScript + WASM that runs everywhere JavaScript runs.
NumPy-Validated
Over 20,000 tests compare outputs directly against NumPy. If NumPy produces a result, numpy-ts matches it.
Type-Safe
Full TypeScript type definitions for every function, dtype, and array operation. Catch errors at compile time, not runtime.
Tree-Shakeable
Import only what you need. Bundlers eliminate unused code automatically, keeping your production builds small.
Quick Example
Get Started
Quickstart
Install numpy-ts and write your first array operations in under 5 minutes.
API Reference
Browse all 476 implemented functions with signatures, parameters, and examples.
Examples
Real-world examples covering linear algebra, signal processing, statistics, and more.
Benchmarks
Detailed performance comparisons against NumPy across 18 categories, multiple dtypes, and array sizes.
Coming from NumPy?
numpy-ts mirrors the NumPy API as closely as possible. Most code translates directly:- Python (NumPy)
- TypeScript (numpy-ts)