Repolode
stdlib-js

stdlib-js/stdlib

A fundamental numerical and scientific computing standard library for JavaScript and TypeScript, running in browsers and Node.js.

Stars
6,000
Forks
1,315
Open issues
1,794
Last commit
14 hours ago

What is it?

stdlib is a standard library focused on numerical and scientific computation, written in JavaScript (with some C) for use in browsers and Node.js. It provides collections of math, statistics, data processing, stream and general utility functions, covering the kind of tooling developers would expect from a standard library in Python or R.

The library is fully decomposable: every function is published as an individual package under the @stdlib scope, so projects can install only what they need, or pull in whole top-level namespaces. Pre-built ES Module, UMD and Deno builds are available for script tags, CDNs and vendored server use, and custom bundles can be generated from a chosen package list.

Beyond core math, the project includes probability distributions, seedable pseudorandom number generators, sample datasets, assertion utilities, a plot API, a benchmark harness and a REPL. Native add-ons for BLAS are offered with pure JavaScript fallbacks, and TypeScript declaration files ship with every function.

Key features

  • 01Over 150 special math functions and 35+ probability distributions with PDF, CDF and quantile support.
  • 02Over 40 seedable pseudorandom number generators.
  • 03Hundreds of utilities for data transformation, functional programming and assertions.
  • 04Individual packages, namespaces and custom bundles can be installed independently.
  • 05Native BLAS add-ons with pure JavaScript fallbacks.
  • 06TypeScript declaration files for every function, plus a REPL and benchmark framework.

Use cases

  • Doing data analysis and statistics in Node.js when you would otherwise reach for Python or R.
  • Adding specific math or statistics functions to a web app without installing a large dependency tree.
  • Vendoring a custom browser or server bundle that includes only the functions a project needs.
  • Generating reproducible random numbers or sample datasets for testing and teaching.

Quick start

  1. 1

    Install the entire library as a dependency with npm

    npm install @stdlib/stdlib
  2. 2

    Or install an individual package, e.g. ndarray array

    npm install @stdlib/ndarray-array
  3. 3

    Require or import the package in your code

Things to know

  • Installing the entire library is heavy, so individual packages are recommended for most projects.

In collections

Topics

FAQ

What is stdlib?
A fundamental numerical and scientific computing standard library for JavaScript and TypeScript, running in browsers and Node.js. stdlib is a standard library focused on numerical and scientific computation, written in JavaScript (with some C) for use in browsers and Node.js. It provides collections of math, statistics, data processing, stream and general utility functions, covering the kind of tooling developers would expect from a standard library in Python or R.
Is stdlib free to use? What license does it have?
stdlib is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is stdlib still maintained?
Actively maintained. The last commit to stdlib was on Oct 24, 2026.
What can I use stdlib for?
Doing data analysis and statistics in Node.js when you would otherwise reach for Python or R. Adding specific math or statistics functions to a web app without installing a large dependency tree. Vendoring a custom browser or server bundle that includes only the functions a project needs. Generating reproducible random numbers or sample datasets for testing and teaching.
How do I install stdlib?
Install the entire library as a dependency with npm: npm install @stdlib/stdlib Or install an individual package, e.g. ndarray array: npm install @stdlib/ndarray-array Require or import the package in your code
Where can I get stdlib?
The source code and installation instructions are on GitHub: https://github.com/stdlib-js/stdlib

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects