stdlib is a comprehensive standard library for JavaScript and TypeScript designed to bring numerical and scientific computing capabilities to the web and Node.js environments. Written in JavaScript with C components, the library provides a decomposable architecture that allows developers to use only the functionality they need rather than being forced to adopt an all-or-nothing approach. The project emphasizes code quality, with maintainers stressing that users can be confident in the thoroughness, rigor, documentation, testing, and measurement applied to every component.
The library encompasses an extensive collection of mathematical and statistical tools. It includes over 150 special math functions, more than 35 probability distributions with support for probability density functions, cumulative distribution functions, quantiles, and moments, and over 40 seedable pseudorandom number generators. Beyond pure mathematics, stdlib provides 200 general utilities for data transformation, functional programming, and asynchronous control flow, along with 200 assertion utilities for data validation and feature detection. The project also includes 50 sample datasets useful for testing and development purposes.
A distinctive feature of stdlib is its plot API for data visualization and exploratory data analysis, enabling users to create visualizations directly within their JavaScript environment. The library includes native add-ons for interfacing with BLAS libraries while maintaining pure JavaScript fallbacks for broader compatibility. Additional tooling includes a benchmark framework supporting TAP and a REPL environment with integrated help and examples, making it suitable for interactive numerical work.
The library is designed for multiple deployment scenarios. It can be bundled using Browserify, Webpack, and other bundlers for browser use, consumed via CDN through pre-built UMD bundles, or used as ES Modules. Every function includes TypeScript declaration files, ensuring type safety and enabling intelligent code completion in modern IDEs. Installation flexibility allows users to install individual packages, top-level namespaces, or the entire project depending on their specific needs.
Community engagement around stdlib is active and structured. GitGenius data shows a median issue and pull request response latency of 9 hours across 1904 tracked items, with mean latency of 2924.1 hours reflecting the project's long history. The most active labels are Good First Issue with 1396 occurrences, RFC with 911, and Accepted with 814, indicating a well-organized contribution process. Primary contributors tracked by GitGenius include kgryte with 3706 events and Planeshifter with 3220 events. The project maintains connections with other repositories including github/gh-aw, solo-io/gloo, and microsoft/vscode through overlapping contributors. The library is licensed under Apache-2.0 and maintains a public calendar of events including open office hours, a Zulip chat community, and presence on Bluesky for social engagement.