API Reference
numpy-ts implements 476 out of 507 NumPy functions (93.9% coverage) in pure TypeScript with zero dependencies. Every function is tested against NumPy for correctness.Coverage by category
How to read this reference
Each function page follows a consistent format: Signature — The full TypeScript signature with generics and overloads where applicable.
Return type — What the function returns (scalar when reducing all axes,
NDArray when reducing along a single axis).
Example — A short, runnable code snippet demonstrating typical usage.
All type signatures use the
NDArray class from the default numpy-ts entry point. If you use the tree-shakeable numpy-ts/core entry point, return types are NDArrayCore instead. The API is otherwise identical.Intentionally unplanned features
The following NumPy features are not implemented by design (31 functions):- Datetime types —
datetime64andtimedelta64dtypes. Use native JavaScriptDateor libraries likedate-fnsinstead. - Fortran-order layout —
order='F'parameter. All arrays use C-contiguous (row-major) layout. - Object dtype —
dtype=object. JavaScript does not have an equivalent concept. - String dtypes —
dtype='U'anddtype='S'. Use native JavaScript strings and typed arrays separately.
Quick links
NDArray Class
Properties, core methods, and the NDArray / NDArrayCore hierarchy.
NDArray Methods
100+ chainable instance methods on NDArray (arithmetic, reductions, shape, linalg, and more).
Array Creation
array, zeros, ones, arange, linspace, eye, and all *_like variants.
Linear Algebra
linalg.inv, linalg.det, linalg.eig, linalg.svd, linalg.solve, and more.
Random
53 random number generation functions including distributions and sampling.
FFT
Discrete Fourier transforms: fft, ifft, rfft, irfft, fft2, fftfreq, and more.