# stdlib-js/stdlib architecture

> Architecture diagram of the GitHub repository stdlib-js/stdlib, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stdlib-js/stdlib
- Repository: https://github.com/stdlib-js/stdlib

## Overview

stdlib is a decomposable JavaScript/C standard library for numerical and scientific computing, with Node.js and browser use. A typical user imports the package, accesses its top-level namespace, then uses a domain API to compute or process data. The tree also exposes repository-wide JavaScript and Markdown quality tooling. README-described library capabilities are represented by namespace-level nodes; their individual implementations are not present in the supplied tree, so the namespace registrations in `lib/main.js` are the available source evidence.

Main entry points: [`lib/main.js`](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js) (Top-level namespace), [`lib/index.js`](https://github.com/stdlib-js/stdlib/blob/develop/lib/index.js) (Package import), [`etc/remark/plugins/lint/index.js`](https://github.com/stdlib-js/stdlib/blob/develop/etc/remark/plugins/lint/index.js) (Markdown lint rules), [`eslint.config.js`](https://github.com/stdlib-js/stdlib/blob/develop/eslint.config.js) (ESLint configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Package entry"]
  node_import["Package import<br/>[index.js]"]
  node_namespace["Top-level namespace<br/>[main.js]"]
end

subgraph group_compute["Numerical computing"]
  node_math["Math and special functions<br/>[main.js]"]
  node_stats["Statistics and distributions<br/>[main.js]"]
  node_random["Random generators<br/>[main.js]"]
  node_blas["BLAS and linear algebra<br/>[main.js]"]
end

subgraph group_data["Data and developer APIs"]
  node_plot["Plotting and analysis<br/>[main.js]"]
  node_datasets["Sample datasets<br/>[main.js]"]
  node_streams["Streams and processing<br/>[main.js]"]
  node_benchmark["Benchmark framework<br/>[main.js]"]
  node_repl["REPL and help<br/>[main.js]"]
end

subgraph group_utility["General utilities"]
  node_assert["Assertions<br/>[main.js]"]
  node_utils["General utilities<br/>[main.js]"]
end

subgraph group_quality["Repository quality tooling"]
  node_eslint["ESLint rules<br/>[typescript.js]"]
  node_eslintconfig["ESLint configuration<br/>[eslint.config.js]"]
  node_remark["Markdown plugin set<br/>[base.js]"]
  node_remarklint["Markdown lint rules<br/>[index.js]"]
  node_remarkjsdoc["JSDoc lint plugins<br/>[jsdoc.js]"]
  node_copy["Config object copy<br/>[copy.js]"]
  node_merge["Config object merge<br/>[merge.js]"]
end

node_user(("Library user"))

node_user -->|"imports"| node_import
node_import -->|"loads"| node_namespace
node_namespace -->|"registers"| node_math
node_namespace -->|"registers"| node_stats
node_namespace -->|"registers"| node_random
node_namespace -->|"registers"| node_blas
node_namespace -->|"registers"| node_plot
node_namespace -->|"registers"| node_datasets
node_namespace -->|"registers"| node_streams
node_namespace -->|"registers"| node_benchmark
node_namespace -->|"registers"| node_repl
node_namespace -->|"registers"| node_assert
node_namespace -->|"registers"| node_utils
node_eslintconfig -->|"loads rules"| node_eslint
node_remark -->|"includes"| node_remarklint
node_remarkjsdoc -->|"includes"| node_remarklint
node_merge -->|"copies values"| node_copy

click node_import "https://github.com/stdlib-js/stdlib/blob/develop/lib/index.js"
click node_namespace "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_math "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_stats "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_random "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_blas "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_plot "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_datasets "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_streams "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_benchmark "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_repl "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_assert "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_utils "https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js"
click node_eslint "https://github.com/stdlib-js/stdlib/blob/develop/etc/eslint/rules/typescript.js"
click node_eslintconfig "https://github.com/stdlib-js/stdlib/blob/develop/eslint.config.js"
click node_remark "https://github.com/stdlib-js/stdlib/blob/develop/etc/remark/plugins/base.js"
click node_remarklint "https://github.com/stdlib-js/stdlib/blob/develop/etc/remark/plugins/lint/index.js"
click node_remarkjsdoc "https://github.com/stdlib-js/stdlib/blob/develop/etc/remark/plugins/lint/jsdoc.js"
click node_copy "https://github.com/stdlib-js/stdlib/blob/develop/etc/eslint/utils/copy.js"
click node_merge "https://github.com/stdlib-js/stdlib/blob/develop/etc/eslint/utils/merge.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_import,node_namespace,node_user toneBlue
class node_math,node_stats,node_random,node_blas toneAmber
class node_plot,node_datasets,node_streams,node_benchmark,node_repl toneMint
class node_assert,node_utils toneRose
class node_eslint,node_eslintconfig,node_remark,node_remarklint,node_remarkjsdoc,node_copy,node_merge toneIndigo
```

## Components

### Package entry

- [Package import](https://github.com/stdlib-js/stdlib/blob/develop/lib/index.js): `lib/index.js`
- [Top-level namespace](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`

### Numerical computing

- [Math and special functions](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [Statistics and distributions](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [Random generators](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [BLAS and linear algebra](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`

### Data and developer APIs

- [Plotting and analysis](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [Sample datasets](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [Streams and processing](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [Benchmark framework](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [REPL and help](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`

### General utilities

- [Assertions](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`
- [General utilities](https://github.com/stdlib-js/stdlib/blob/develop/lib/main.js): `lib/main.js`

### Repository quality tooling

- [ESLint rules](https://github.com/stdlib-js/stdlib/blob/develop/etc/eslint/rules/typescript.js): `etc/eslint/rules/typescript.js`
- [ESLint configuration](https://github.com/stdlib-js/stdlib/blob/develop/eslint.config.js): `eslint.config.js`
- [Markdown plugin set](https://github.com/stdlib-js/stdlib/blob/develop/etc/remark/plugins/base.js): `etc/remark/plugins/base.js`
- [Markdown lint rules](https://github.com/stdlib-js/stdlib/blob/develop/etc/remark/plugins/lint/index.js): `etc/remark/plugins/lint/index.js`
- [JSDoc lint plugins](https://github.com/stdlib-js/stdlib/blob/develop/etc/remark/plugins/lint/jsdoc.js): `etc/remark/plugins/lint/jsdoc.js`
- [Config object copy](https://github.com/stdlib-js/stdlib/blob/develop/etc/eslint/utils/copy.js): `etc/eslint/utils/copy.js`
- [Config object merge](https://github.com/stdlib-js/stdlib/blob/develop/etc/eslint/utils/merge.js): `etc/eslint/utils/merge.js`

### Other components

- **Library user**

## Connections

- Library user → Package import: imports (evidence: `lib/index.js`)
- Package import → Top-level namespace: loads (evidence: `lib/index.js`)
- Top-level namespace → Math and special functions: registers (evidence: `lib/main.js`)
- Top-level namespace → Statistics and distributions: registers (evidence: `lib/main.js`)
- Top-level namespace → Random generators: registers (evidence: `lib/main.js`)
- Top-level namespace → BLAS and linear algebra: registers (evidence: `lib/main.js`)
- Top-level namespace → Plotting and analysis: registers (evidence: `lib/main.js`)
- Top-level namespace → Sample datasets: registers (evidence: `lib/main.js`)
- Top-level namespace → Streams and processing: registers (evidence: `lib/main.js`)
- Top-level namespace → Benchmark framework: registers (evidence: `lib/main.js`)
- Top-level namespace → REPL and help: registers (evidence: `lib/main.js`)
- Top-level namespace → Assertions: registers (evidence: `lib/main.js`)
- Top-level namespace → General utilities: registers (evidence: `lib/main.js`)
- ESLint configuration → ESLint rules: loads rules (evidence: `eslint.config.js`)
- Markdown plugin set → Markdown lint rules: includes (evidence: `etc/remark/plugins/base.js`)
- JSDoc lint plugins → Markdown lint rules: includes
- Config object merge → Config object copy: copies values (evidence: `etc/eslint/utils/merge.js`)
