Stdlib roadmap: JavaScript will finally get a standard library

Details emerge as to what the expansive standard library will offer—as well as its focus on numerical and scientific computing applications

Stdllb roadmap: JavaScript will finally get a standard library
Loughborough University Library (CC BY 2.0)

Known for its lack of a large standard library, JavaScript is set to gain a much more functional and larger standard library, under a third-party initiative happening outside the JavaScript standardization process. The library also will serve the Node.js server-side JavaScript runtime.

Called Stdlib, the open source project focuses on numerical and scientific computing applications, which itself shows how JavaScript is growing beyond its web development roots. Stdlib will offer a collection of libraries for mathematics, statistics, data processing, and streams, and it will offer many of the utilities expected from a standard library, its creators say.

The Stdlib effort goes against JavaScript creator Brendan Eich’s preference to keep JavaScript’s standard library small and have it evolve incrementally. Instead, Stdlib is a continuation of third-party efforts to expand JavaScript functionality beyond what the official ECMAScript standard offers. (Eich is not involved in Stdlib, said Philipp Burkhardt, a key contributor to the project.) 

Although the Stdlib effort began in 2016, details as to its functoniality have only recently been revealed.

Where to download Stdlib

You can download the beta Stdlib source code from GitHub. Version 0.34 is the current beta.

Features planned for the Stdlib JavaScript library

The planned Stdlib capabilities include a plot API for data visualization and exploratory data analysis, as well as general utilities for data transformation, functional programming, and asynchronous control flow.

Among the more than 2,000 other functions in the Stdlib are:

  • Special math functions, including exponential, logarithmic, trigonometric, absolute value, rounding. and special functions.
  • Probability distributions, including support for evaluating probability density functions, quantiles, and cumulative distribution functions.
  • General utilities for data transformation, functional programming, and asynchronous control flow.
  • Native add-ons to interface with BLAS (basic linear algebra subprograms), with pure JavaScript fallbacks.
  • Assertion utilities, providing data validation and feature detection.
  • Sample data sets for testing and development.
  • A REPL environment, with integrated help and examples, and a benchmark supporting TAP (Test Anything Protocol).