Do advanced mathematical calculations in JavaScript, gamma functions, Bessel functions, and other special math, without switching to Python or R.
Generate random numbers from specific probability distributions with configurable seeds for reproducible simulations in the browser or Node.js.
Build data analysis or statistics tools in JavaScript using a consistent, well-typed library with TypeScript autocomplete support.
Install only the individual math functions you need from npm as tiny separate packages rather than one large monolithic library.
Install individual packages from npm rather than one large bundle, TypeScript types are included for all functions.
stdlib is a comprehensive standard library for JavaScript and TypeScript focused on numerical and scientific computing. It brings to JavaScript much of the mathematical functionality you would expect from specialized languages like Python with NumPy, R, or MATLAB, making it possible to do serious number crunching in a browser or in Node.js without switching languages. The library covers a wide range of mathematical tools. It includes over 150 special math functions (things like gamma functions, Bessel functions, and other advanced calculations), more than 35 probability distributions with support for probability density functions, cumulative distribution functions, and quantiles, and over 40 random number generators with configurable seeds. It also includes tools for statistics, data transformation, functional programming, input validation, a plotting API for visualizing data, and over 50 sample datasets for testing and development. A core design goal is full decomposability. Rather than one large package, the library is split into thousands of small individual packages, each available separately on npm. You install only what you need. TypeScript declaration files are provided for every function, which means your code editor can offer accurate autocomplete suggestions. Many of the core math routines also have native C add-ons for performance, with pure JavaScript fallbacks when those are not available. The library can run in Node.js or be bundled for browser use with standard tools like Webpack or Browserify. It includes an interactive REPL environment for experimenting with functions directly, a built-in benchmarking framework, and extensive documentation. Installation is via npm, and the project maintains an active community with public office hours, a Zulip chat, and financial support through Open Collective. The full README is longer than what was shown.
← stdlib-js on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.