npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rimbu/core

v2.0.7

Published

Immutable collections and tools for TypeScript

Readme

npm version License Types Included Node Bun ESM + CJS

@rimbu/core

All core Rimbu collections and utilities from a single import.

@rimbu/core is the convenience entry point to the Rimbu ecosystem. It re‑exports the public APIs of the main collection packages (lists, maps, sets, graphs, tables, streams, and more) together with the shared utilities from @rimbu/common, so you can build rich immutable data models without juggling many imports.

Use it when you want:

  • a single dependency that gives you the full set of Rimbu core collections
  • a consistent, fully typed API for immutable data structures
  • both direct imports and a creation “menu” (@rimbu/core/menu) for concise, expressive code

Table of Contents

  1. Why @rimbu/core?
  2. Feature Highlights
  3. Quick Start
  4. Import Styles
  5. What’s Included
  6. Installation
  7. Ecosystem & Integration
  8. Contributing
  9. License
  10. Attributions

Why @rimbu/core?

Rimbu is a collection library focused on immutable, persistent data structures with a strong TypeScript story. Each collection type lives in its own package (e.g. @rimbu/list, @rimbu/hashed, @rimbu/sorted, …), and @rimbu/common provides shared types and utilities used across the ecosystem.

@rimbu/core brings these together:

  • Single import – access all main collections through @rimbu/core.
  • Shared utilities included – get everything from @rimbu/common as part of the same dependency.
  • Consistent experience – unified API surface, aligned docs, and the same immutable semantics throughout.

If you just want to “use Rimbu” without thinking about which sub‑package exports which type, @rimbu/core is what you install.

For full documentation, see the Rimbu Docs and the @rimbu/core API reference.


Feature Highlights

  • All main collections in one placeList, Stream / AsyncStream, HashMap, SortedMap, HashSet, SortedSet, BiMap, BiMultiMap, Table, graphs, multimaps, multisets, and more.
  • Immutable & persistent semantics – structural sharing for efficient copies and diffs.
  • Typed end‑to‑end – works great in TypeScript, with rich generics and non‑empty refinements.
  • Creation “menu” – optional namespace‑style API via @rimbu/core/menu for expressive code like Rimbu.Map.Sorted.of(...).
  • Cross‑runtime support – Node ≥ 18, Deno, Bun, and modern browsers (ESM + CJS builds included).

Each individual collection has its own dedicated documentation and examples, but @rimbu/core lets you reach them all from a single dependency.


Quick Start

Direct imports

import { List, Stream, SortedMap } from '@rimbu/core';

// Build an immutable list
const list = List.of(1, 3, 2, 4, 2);

// Transform it into a stream of entry tuples
const stream = Stream.from(list).map((v) => [v, String(v * 2)] as const);

// Materialize into a sorted map
const map = SortedMap.from(stream);

console.log(map.toArray());
// => [[1, '2'], [2, '4'], [3, '6'], [4, '8']]

Try it online

Experiment with Rimbu (including @rimbu/core) in the browser using the Rimbu Sandbox on CodeSandbox.


Import Styles

1. Direct imports from @rimbu/core

Recommended when you only need a few specific types:

import { List, HashMap, Stream } from '@rimbu/core';

const list = List.of(1, 2, 3);
const map = HashMap.of(['a', 1], ['b', 2]);

const result = Stream.from(map.entries()).toArray();

All public types from the core collection packages are re‑exported here, so you rarely need to import the sub‑packages directly.

2. Using the creation “menu” from @rimbu/core/menu

The “menu” groups key Rimbu types into a single namespace, which is convenient for quick prototyping or REPL usage:

import Rimbu from '@rimbu/core/menu';

const list = Rimbu.List.of(1, 3, 2, 4, 2);

const stream = Rimbu.Stream.from(list).map((v) => [v, String(v * 2)] as const);

const map = Rimbu.Map.Sorted.from(stream);

console.log(map.toArray());
// => [[1, '2'], [2, '4'], [3, '6'], [4, '8']]

Under the hood, this uses the same types that are exported from @rimbu/core, organized into namespaces like Rimbu.Map, Rimbu.Set, Rimbu.Table, and Rimbu.Graph.


What’s Included

@rimbu/core re‑exports the public APIs of the following sub‑packages. Use these packages directly when you need package‑specific documentation, but feel free to import their types through @rimbu/core:

| Package | Description | | ---------------------------------------------- | ------------------------------------------------------------------------------------------ | | @rimbu/bimap | Bidirectional map where each key maps to a unique value and vice versa. | | @rimbu/bimultimap | Bidirectional multimap allowing many‑to‑many mappings between keys and values. | | @rimbu/collection-types | Shared collection type definitions used by all Rimbu collections. | | @rimbu/common | Public types and utility functions used throughout the library. | | @rimbu/deep | Tools (such as Deep and Tuple) for treating plain JS objects as immutable structures. | | @rimbu/graph | Graph implementations for modelling data as nodes and edges. | | @rimbu/hashed | HashMap / HashSet implementations using hash functions for fast key retrieval. | | @rimbu/list | Immutable List for ordered sequences with efficient random access and updates. | | @rimbu/multimap | Map where each key can be associated with multiple values. | | @rimbu/multiset | Set where elements can occur multiple times. | | @rimbu/ordered | OrderedMap / OrderedSet that retain insertion order. | | @rimbu/proximity | ProximityMap for retrieving values based on key proximity. | | @rimbu/sorted | SortedMap / SortedSet implementations that keep elements sorted via compare functions. | | @rimbu/stream | Lazy, composable Stream / AsyncStream types for processing sequences of data. | | @rimbu/table | Table data structures where row/column key pairs map to a single value. |

For a complete overview, start from the Rimbu documentation or jump directly to the @rimbu/core API docs.


Installation

Node / Bun / npm / Yarn / Deno

npm install @rimbu/core
# or
yarn add @rimbu/core
# or
bun add @rimbu/core
# or
deno add npm:@rimbu/core

Browser / ESM

@rimbu/core ships both ESM and CJS builds. Use it with any modern bundler (Vite, Webpack, esbuild, Bun, etc.) or directly in Node ESM projects.


Ecosystem & Integration

  • Part of the broader Rimbu collection ecosystem – interoperates with packages like @rimbu/hashed, @rimbu/ordered, @rimbu/collection-types, and @rimbu/stream.
  • Designed for immutable, persistent data models in TypeScript and JavaScript applications.
  • Works well in Node services, browser apps, and Deno/Bun runtimes.

Explore more at the Rimbu documentation and the @rimbu/core API docs.


Contributing

We welcome contributions! See the Contributing guide for details.

Made with contributors-img.


License

MIT © Rimbu contributors. See LICENSE for details.


Attributions

Created and maintained by Arvid Nicolaas. Logo © Rimbu.