Returns the next buffer/object in a Node.js stream's readable queue without consuming it. Version 1.0.3 is the latest stable release. The package is minimal and focused, primarily used internally by higher-level stream utilities. It works on Node.js 6+ and is commonly used in modules like `pump`, `through2`, and others that need to peek into a stream's internal buffer. It is not a user-facing tool but a low-level utility for stream manipulation.
npm install stream-shiftNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using stream-shift to read the next buffers from a readable stream's queue without consuming them.
Always check for null before using the returned value.
Use shift() only for peeking; consume the stream normally with read() or 'data' event to advance the queue.
Ensure your stream is in object mode if you expect objects, or in binary mode for Buffers.
Use shift(stream) instead of stream.shift() and import shift from 'stream-shift'.
Use const shift = require('stream-shift'); instead.No dependency data recorded yet.