# mnemonist

> Curated collection of data structures for the JavaScript/TypeScript.

Latest version **0.40.5** (published 2026-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install mnemonist
pnpm add mnemonist
yarn add mnemonist
bun add mnemonist
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.40.5 |
| Published | 2026-09-22 |
| First published | 2016-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 375.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2433 |
| Author | Guillaume Plique |
| Maintainers | yomguithereal |
| Keywords | bag, bimap, bit array, bit set, bit vector, bitset, bk tree, burkhard-keller tree, cache, circular buffer, counter, data structures, default map, deque, disjoint set, fibonacci heap, fuzzy map, hashed array tree, heap, interval tree, inverted index, kd tree, linked list, lru, lru cache, multimap, multiset, passjoin, queue, sparse map, sparse set, stack, structures, suffix tree, symspell, trie, union find, vantage point tree, vector, vp tree |

## Links

- npm: https://www.npmjs.com/package/mnemonist
- Repository: https://github.com/yomguithereal/mnemonist
- Homepage: https://github.com/yomguithereal/mnemonist#readme
- Issues: https://github.com/yomguithereal/mnemonist/issues
- npm.io page: https://npm.io/package/mnemonist

## Dependencies (1)

- [obliterator](https://npm.io/package/obliterator.md) ^2.0.4

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.40.5 (latest) — 2026-09-22
- 0.40.0-rc1 (rc) — 2024-02-02
- 0.23.0-beta1 (beta) — 2018-05-28
- 0.40.4 — 2026-04-30
- 0.40.3 — 2025-02-19
- 0.40.2 — 2025-02-07
- 0.40.1 — 2025-02-06
- 0.40.0 — 2025-01-26
- 0.39.8 — 2024-02-02
- 0.39.7 — 2024-01-02
- 0.39.6 — 2023-12-05
- 0.39.5 — 2022-10-30
- 0.39.4 — 2022-10-20
- 0.39.3 — 2022-10-04
- 0.39.2 — 2022-06-03
- … 60 more at https://npm.io/package/mnemonist/versions

## README

[![Build Status](https://github.com/Yomguithereal/mnemonist/actions/workflows/tests.yml/badge.svg)](https://github.com/Yomguithereal/mnemonist/actions)

# Mnemonist

Mnemonist is a curated collection of data structures for the JavaScript language.

It gathers classic data structures (think heap, trie etc.) as well as more exotic ones such as Buckhard-Keller trees etc.

It strives at being:

* As performant as possible for a high-level language.
* Completely modular (don't need to import the whole library just to use a simple heap).
* Simple & straightforward to use and consistent with JavaScript standard objects' API.
* Completely typed and comfortably usable with Typescript.

## Installation

```
npm install --save mnemonist
```

## Documentation

Full documentation for the library can be found [here](https://yomguithereal.github.io/mnemonist).

**Classics**

* [Heap](https://yomguithereal.github.io/mnemonist/heap)
* [Linked List](https://yomguithereal.github.io/mnemonist/linked-list)
* [LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache), [LRUMap](https://yomguithereal.github.io/mnemonist/lru-map)
* [MultiMap](https://yomguithereal.github.io/mnemonist/multi-map)
* [MultiSet](https://yomguithereal.github.io/mnemonist/multi-set)
* [Queue](https://yomguithereal.github.io/mnemonist/queue)
* [Set (helpers)](https://yomguithereal.github.io/mnemonist/set)
* [Stack](https://yomguithereal.github.io/mnemonist/stack)
* [Trie](https://yomguithereal.github.io/mnemonist/trie)
* [TrieMap](https://yomguithereal.github.io/mnemonist/trie-map)

**Low-level & structures for very specific use cases**

* [Circular Buffer](https://yomguithereal.github.io/mnemonist/circular-buffer)
* [Fixed Deque](https://yomguithereal.github.io/mnemonist/fixed-deque)
* [Fibonacci Heap](https://yomguithereal.github.io/mnemonist/fibonacci-heap)
* [Fixed Reverse Heap](https://yomguithereal.github.io/mnemonist/fixed-reverse-heap)
* [Fixed Stack](https://yomguithereal.github.io/mnemonist/fixed-stack)
* [Hashed Array Tree](https://yomguithereal.github.io/mnemonist/hashed-array-tree)
* [Static DisjointSet](https://yomguithereal.github.io/mnemonist/static-disjoint-set)
* [SparseQueueSet](https://yomguithereal.github.io/mnemonist/sparse-queue-set)
* [SparseMap](https://yomguithereal.github.io/mnemonist/sparse-map)
* [SparseSet](https://yomguithereal.github.io/mnemonist/sparse-set)
* [Suffix Array](https://yomguithereal.github.io/mnemonist/suffix-array)
* [Generalized Suffix Array](https://yomguithereal.github.io/mnemonist/generalized-suffix-array)
* [Vector](https://yomguithereal.github.io/mnemonist/vector)

**Information retrieval & Natural language processing**

* [Fuzzy Map](https://yomguithereal.github.io/mnemonist/fuzzy-map)
* [Fuzzy MultiMap](https://yomguithereal.github.io/mnemonist/fuzzy-multi-map)
* [Inverted Index](https://yomguithereal.github.io/mnemonist/inverted-index)
* [Passjoin Index](https://yomguithereal.github.io/mnemonist/passjoin-index)
* [SymSpell](https://yomguithereal.github.io/mnemonist/symspell)

**Space & time indexation**

* [Static IntervalTree](https://yomguithereal.github.io/mnemonist/static-interval-tree)
* [KD-Tree](https://yomguithereal.github.io/mnemonist/kd-tree)

**Metric space indexation**

* [Burkhard-Keller Tree](https://yomguithereal.github.io/mnemonist/bk-tree)
* [Vantage Point Tree](https://yomguithereal.github.io/mnemonist/vp-tree)

**Probabilistic & succinct data structures**

* [BitSet](https://yomguithereal.github.io/mnemonist/bit-set)
* [BitVector](https://yomguithereal.github.io/mnemonist/bit-vector)
* [Bloom Filter](https://yomguithereal.github.io/mnemonist/bloom-filter)

**Utility classes**

* [BiMap](https://yomguithereal.github.io/mnemonist/bi-map)
* [DefaultMap](https://yomguithereal.github.io/mnemonist/default-map)
* [DefaultWeakMap](https://yomguithereal.github.io/mnemonist/default-weak-map)

---

Note that this list does not include a `Graph` data structure, whose implementation is usually far too complex for the scope of this library.

However, we advise the reader to take a look at the [`graphology`](https://graphology.github.io/) library instead.

Don't find the data structure you need? Maybe we can work it out [together](https://github.com/Yomguithereal/mnemonist/issues).

## Contribution

Contributions are obviously welcome. Be sure to lint the code & add relevant unit tests.

```
# Installing
git clone git@github.com:Yomguithereal/mnemonist.git
cd mnemonist
npm install

# Linting
npm run lint

# Running the unit tests
npm test
```

## License

[MIT](LICENSE.txt)

---
_Source: https://npm.io/package/mnemonist · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
