Cyforanumera
npm

v1.0.3 · released 2026-10-03

NumPy for JavaScript, running natively.

numera follows NumPy's API and behaviour: n-dimensional arrays, broadcasting, ufuncs, linear algebra, FFT and random numbers. The numerical work runs in a C++ core, and the API is fully typed for TypeScript.

Terminal
npm install @cyfora/numera
Python · NumPy
import numpy as np

a = np.array([[1, 2, 3], [4, 5, 6]])
a.sum(axis=0)          # -> array([5, 7, 9])
a[:, ::2]              # -> [[1, 3], [4, 6]]
np.linalg.solve([[3, 1], [1, 2]], [9, 8])
                       # -> array([2., 3.])
TypeScript · numera
import np from "@cyfora/numera";

const a = np.array([[1, 2, 3], [4, 5, 6]]);
a.sum({ axis: 0 });    // => [5, 7, 9]
a.slice([null, [null, null, 2]]); // => [[1, 3], [4, 6]]
np.linalg.solve([[3, 1], [1, 2]], [9, 8]);
                       // => [2, 3]
99.1%of the NumPy 2.5.3 API (1045 of 1054 names)
447documented entries with tested examples
106universal functions
C++20native core via Node-API

What numera is#

numera is an n-dimensional array library for Node.js. It follows NumPy's API and behaviour closely, so code and knowledge carry over: the same dtypes and promotion rules, the same broadcasting, the same results from np.linalg, np.fft and seeded random generators. The numerical loops run in a C++20 core loaded as a Node-API addon. The TypeScript layer on top validates arguments and translates errors, and it gives every function a typed signature.

NumPy semantics

1045 of the 1054 NumPy 2.5.3 names numera tracks are implemented (99.1%). Behaviour is checked against real NumPy by thousands of differential test cases.

Native speed

Array data lives in native memory, and loops run in C++ instead of per-element JavaScript. On macOS, linear algebra uses Apple Accelerate.

Typed API

Every function has TypeScript declarations. Keyword arguments become typed option objects, and errors are typed classes such as ShapeError and LinAlgError.

Reproducible random numbers

np.random.defaultRng(seed) and np.random.seed(seed) produce the same numbers as NumPy, bit for bit.

Broad coverage

106 ufuncs with out, where and ufunc methods, plus linalg, fft, random, ma, strings, polynomial, emath, testing, file I/O and datetimes.

No build step

Prebuilt binaries ship for macOS and Linux on x64 and arm64. You do not need a compiler, CMake or Python.

A first look#

JavaScript
import np from "@cyfora/numera";

const a = np.array([[1, 2, 3], [4, 5, 6]]);
a.shape;                        // => [2, 3]
a.dtype.name;                   // => "int64"
np.add(a, 10);                  // => [[11, 12, 13], [14, 15, 16]]
a.sum({ axis: 0 });             // => [5, 7, 9]
np.mean(a, { axis: 1 });        // => [2, 5]
np.linalg.solve([[3, 1], [1, 2]], [9, 8]); // => [2, 3]

In these docs, a // => comment shows the value of the expression. For an NDArray, that is .toArray(). The test suite runs every example in the API reference and every guide example.

Where to go next#