SkillAgentSearch skills...

Stdlib

✨ The fundamental numerical library for JavaScript and TypeScript. ✨

Install / Use

/learn @stdlib-js/Stdlib

README

<!-- @license Apache-2.0 Copyright (c) 2018 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- lint disable first-heading-level expected-html-sections --> <!-- Section to include announcements. If section is included, add a horizontal rule *after* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> <section class="announcement"> </section> <!-- /.announcement --> <!-- Section to include assets such as the project logo, etc. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> <section class="banner"> <div class="image" align="center"> <br> <br> <a href="https://stdlib.io/" /> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@9f7d30f089ecc458a8b836a75afab75caf5c0b36/docs/assets/logo_banner.svg" alt="stdlib logo"> </a> <br> <br> <br> <br> </div> </section> <!-- /.banner -->
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> <section class="intro">

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib.

stdlib ([/ˈstændərd lɪb/][ipa-english] "standard lib") is a standard library with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js. The library provides a collection of robust, high performance libraries for mathematics, statistics, data processing, streams, and more and includes many of the utilities you would expect from a standard library.

What sets stdlib apart is its fully decomposable architecture, which allows you to swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be confident that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code available.

Want to join us in bringing numerical computing to the web? Start by starring the project. :star2:

Explore this GitHub repository for stdlib's source code and documentation. For guidance on developing stdlib, refer to the [development guide][stdlib-development].

Thank you for being a part of our community! Your support is invaluable to us!

Resources

  • Installation
  • [Homepage][stdlib-homepage]
  • [Documentation][stdlib-documentation]
  • [Source code][stdlib-source]
  • [Code coverage][stdlib-code-coverage]
  • [FAQ][stdlib-faq]

External Resources

  • [Google Calendar][stdlib-public-calendar]: calendar of public events, including [open office hours][stdlib-office-hours].
  • [Open Collective][open-collective-stdlib]: financially support the project.
  • [Bluesky][stdlib-bluesky]: follow us on social media.
  • [Zulip][stdlib-zulip]: chat with project maintainers and other community members.

Features

  • 150+ [special math functions][@stdlib/math/base/special].

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@203839353bc74297fe641207270f7917d2bda560/docs/assets/readme/base_special_math.png" alt="Demo showcasing special math functions"> </div>
  • 35+ [probability distributions][@stdlib/stats/base/dists], with support for evaluating probability density functions (PDFs), cumulative distribution functions (CDFs), quantiles, moments, and more.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@e13885087939c064c69aa43ee80ea52710de5591/docs/assets/readme/base_dists.png" alt="Demo showcasing probability distributions"> </div>
  • 40+ [seedable pseudorandom number generators][@stdlib/random/base] (PRNGs).

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@83dcd0fad98883320a8b1efc801b2fc1ed2a003d/docs/assets/readme/base_prngs.png" alt="Demo showcasing PRNGs"> </div>
  • 200+ general [utilities][@stdlib/utils] for data transformation, functional programming, and asynchronous control flow.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@e6eeea31e49d6db1b6f57ae59d2988d4b427e285/docs/assets/readme/utils.png" alt="Demo showcasing general utilities"> </div>
  • 200+ [assertion utilities][@stdlib/assert] for data validation and feature detection.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@6970c8b4eb546a10712734d225c15863db9b2c92/docs/assets/readme/assert.png" alt="Demo showcasing assertion utilities"> </div>
  • 50+ [sample datasets][@stdlib/datasets] for testing and development.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@f71a38e62247e31dc47d248f6f1b3e434abeb971/docs/assets/readme/datasets.png" alt="Demo showcasing sample datasets"> </div>
  • A [plot API][@stdlib/plot/ctor] for data visualization and exploratory data analysis.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@39d75174b24ea2a84828d9624643776a164478e4/docs/assets/readme/plot.png" alt="Demo showcasing plot API"> </div>
  • Native add-ons for interfacing with BLAS libraries, with pure JavaScript fallbacks.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@efede6af3ef957da08838903b0558441263adf85/docs/assets/readme/base_blas.png" alt="Demo showcasing BLAS APIs"> </div>
  • A [benchmark framework][@stdlib/bench/harness] supporting TAP.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@4833049f8d1895585bd51ec6fa97b8ca0d37c6fb/docs/assets/readme/benchmark.gif" alt="Demo showcasing benchmark framework"> </div>
  • REPL environment with integrated help and examples.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@3864ae6f86bbc215956c0e667d82d49a6eaca780/docs/assets/readme/repl.gif" alt="Demo showcasing REPL environment"> </div>
  • Can be bundled using [Browserify][browserify], [Webpack][webpack], and other bundlers for use in web browsers.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@e54894a93697653dda22d11cd0aec1ccb292b7b8/docs/assets/readme/bundled.png" alt="Demo showcasing browser support"> </div>
  • Every function is accompanied by [TypeScript][typescript] declaration files, ensuring type safety and facilitating intelligent code completion in IDEs.

    <div class="image" align="center"> <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@f5f1f915a7178d9bc76a95d34afd799e6092ec3a/docs/assets/readme/typescript.png" alt="Demo showcasing TypeScript declaration files" > </div>

Installation

To accommodate various use cases, stdlib can be used in multiple ways. The preferred method of use depends on your individual use case. We've provided some user stories to help you identify the best approach. 😃

While this project's installation instructions default to using [npm][npm] for package management, installation via other package managers, such as [yarn][yarn], should be a matter of simply swapping out [npm][npm] commands with those of the relevant package manager.

User Stories

  • I want to perform data analysis and data science tasks in JavaScript and Node.js, similar to how I might use Python, Julia, R, and MATLAB.

  • I am building a web application.

    • I plan on using [Browserify][browserify], [Webpack][webpack], and other bundlers for use in web browsers.

      • Install individual packages. Installing the entire project is likely unnecessary and will lead to slower installation times.
    • I would like to vendor a custom bundle containing various stdlib functionality.

    • I would like to include stdlib functionality by just using a script tag.

      • I would like to use ES Modules.

        • Use an individual package's ES Module build.
      • I would like to use a pre-built bundle (possibly via a CDN, such as [unpkg][unpkg] or [jsDelivr][jsdelivr]).

        • Install (or consume via a CDN) an individual package's pre-built UMD browser bundle.
    • I am interested in using a substantial amount of functionality found in a top-level stdlib namespace and don't want to separately install hundreds of individual packages (e.g., if building an on-line calculator application and wanting all of stdlib's math functionality).

      • Install one or more top-level namespaces. Installing the entire project is likely unnecessary and will lead to slower installation times. Installing a top-level namespace is likely to mean installing functionality which will never be used; however, installing a top-level namespace is likely to be easier and less time-consuming than installing many individual packages separately.

        When bundl

View on GitHub
GitHub Stars5.8k
CategoryDevelopment
Updated17m ago
Forks1.2k

Languages

JavaScript

Security Score

100/100

Audited on Apr 4, 2026

No findings