Skip to main content

Welcome to Rimbu

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools. Its main aim is to enable developers to create safe and efficient programs without getting in the way. Inspired by various collection libraries such as Java's Guava, Java 8 Collection, and Scala's collection library, Rimbu brings together the best ideas from these sources and the Scala community.

Library Contents

Collections

Rimbu's core package, @rimbu/core, includes a wide range of commonly used collection types:

  • List: A block-based random-access structure similar to a Vector.
  • Maps: Includes HashMap, SortedMap, and OrderedMap.
  • Sets: Includes HashSet, SortedSet, and OrderedSet.
  • Stream: Facilitates the creation and conversion of data streams.

Additionally, Rimbu offers less commonly used but highly useful collections:

Immutable Object Utilities

Beyond collections, Rimbu provides tools to treat plain JavaScript objects as immutable or deeply readonly objects. Key utilities include:

All collections are designed to efficiently handle data sets ranging from small to very large (as long as they fit in memory). Persistence is maximized to ensure minimal memory usage. When modifying a collection instance, Rimbu makes every effort to keep references to unchanged elements the same.

Quick Overview of Features and Benefits

  • Extensive Collection Types: Covers a wide range of problems, reducing the need for additional coding.
  • Advanced Typing: Leverages the TypeScript compiler for strict type inference with minimal explicit typing.
  • No External Dependencies: Except for ts-lib, ensuring lightweight and fast performance.
  • Customizable and Configurable: Provides sensible defaults with extensive customization options.
  • Efficient Immutable List: Features a unique and efficient immutable random-access List implementation.