A Node.js utility to detect if a value is a Node.js stream, including readable, writable, duplex, and transform streams.
is-stream is a Node.js utility library that detects whether a value is a Node.js stream. It solves the problem of safely handling stream-based APIs by providing accurate type checking for different stream types, preventing runtime errors when working with asynchronous data flows.
Node.js developers working with stream-based APIs, file processing, network communication, or any code that needs to reliably identify stream objects.
Developers choose is-stream because it provides comprehensive, reliable stream detection with support for all Node.js stream types, including HTTP-related streams, in a lightweight, well-tested package with minimal dependencies.
Check if something is a Node.js stream
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Detects all Node.js stream types, including readable, writable, duplex, transform, and HTTP-specific streams like IncomingMessage and OutgoingMessage, as detailed in the API section.
Accurately identifies streams to prevent runtime errors when passing values to stream-based APIs, ensuring safer handling of asynchronous data flows.
Follows the Unix philosophy with minimal dependencies and a focused scope, making it easy to integrate without bloat, as highlighted in the philosophy.
Optional checkOpen option allows detecting if streams are still open, adding an extra layer of safety for stream operations, as mentioned in the options.
Exclusively supports Node.js stream implementations and does not work with browser-based web streams or other environments, limiting cross-platform use.
Pure type checking library; offers no functionality for creating, transforming, or modifying streams, which might require additional tools.
For basic stream detection, native methods like instanceof might suffice, making the library unnecessary in minimalistic setups.