Skip to content
Eugene Lazutkin edited this page May 22, 2026 · 8 revisions

Dashboard

Node.js CI NPM version

About

stream-sorting is a streaming sort plus a suite of operations on sorted object-mode Readable streams. The headline operation is a disk-backed external merge sort designed to sort a billion records on a laptop without OOMing. On top of the sort, the package builds key-based join, set operations (union / intersection / difference), and k-way sorted merge.

Scope of the package: anything that requires or preserves sortedness. Combinators that know nothing about sortedness live in stream-join; 1→N split / route / filter lives in stream-fork. Built on stream-chain and stream-join — its only runtime dependencies. Node-only (server / CLI); browsers are out of scope. ESM only. Distributed under the New BSD license.

Status

Scaffold phase. The repo layout and conventions are in place; component implementations land incrementally. The pages below describe the intended API surface.

Documentation

Main components (planned)

  • sort — disk-backed external merge sort. The headline operation.
  • mergeJoin / joinBy — SQL-style key-based join of two sorted streams (inner / left / right / full).
  • union — sorted merge with cross-stream deduplication.
  • intersection — values present in all input streams.
  • difference — values in one stream not present in the others.
  • mergeSorted — k-way sorted merge without deduplication; the suite's foundational op.

Other

Installation

npm i stream-sorting

Clone this wiki locally