Queue data from a stream until a checkpoint condition is met. Version 0.1.2. A transform stream that buffers incoming data until a user-defined function returns true for a checkpoint, then flushes the buffer. Useful for handling retries in streaming APIs with periodic tokens. Built on through2. Minimal API with configurable max queue size and object mode. No known active development.
npm install checkpoint-streamNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use checkpoint-stream with object mode to buffer data until a checkpoint token is encountered.
Ensure the isCheckpointFn handles the raw chunk (string/buffer/object) based on stream mode.
Listen to 'data' events for buffered objects, and 'checkpoint' for the trigger object.
Set maxQueued to 0 or Infinity based on desired behavior (0 disables flushing, Infinity never flushes).
Consider rewriting with native Node.js streams using Transform class.
Use checkpoint.obj(fn) for object mode streams, or pass { isCheckpointFn: fn, objectMode: true } to checkpoint().Use checkpoint(config) to create a stream instance, not checkpoint.new or similar.
Run npm install through2 --save alongside checkpoint-stream.
Ensure isCheckpointFn returns a boolean (true or false).