level-read-stream provides Node.js-style readable streams for abstract-level compatible databases. It allows developers to consume data from a LevelDB-like database as a stream of entries, keys, or values. The current stable version is 2.0.0, which notably supports `abstract-level` v2 and Node.js >=18. The project maintains an active development pace with incremental releases addressing compatibility and adding features like TypeScript types. Key differentiators include its tight integration with the `abstract-level` API, offering `EntryStream`, `KeyStream`, and `ValueStream` for optimized data retrieval. For Web Streams, users are directed to `level-web-stream`.
npm install level-read-streamVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to create an `EntryStream` to read key-value pairs from an `abstract-level` database, filter by a starting key (`gte: 'b'`), and pipe the results to a writable stream for processing, logging each entry.
Ensure your database package (e.g., `level`, `memdown`) is updated to a version compatible with `abstract-level@2`.
Review your stream pipeline for compatibility with `readable-stream` v4 behavior, especially if you have custom `_read` or `_write` implementations.
Run `npm install --save-dev @types/readable-stream`.
Refer to `https://github.com/Level/read-stream/blob/main/UPGRADING.md` for detailed instructions.
Consider `for await (const entry of db.iterator(options))` instead of piping `EntryStream` for simple async iteration.
Upgrade your database package (e.g., `level`, `memdown`) to a version that implements `abstract-level` v2 or higher.
Change your import statement to `import { EntryStream } from 'level-read-stream';` and ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`).Use `const { EntryStream } = require('level-read-stream');` to correctly destructure the named export.Install the types package: `npm install --save-dev @types/readable-stream`.