Combine readable and writable streams into a single duplex stream with async initialization and streams1/streams2 support.
duplexify is a Node.js library that combines separate readable and writable streams into a single duplex stream. It solves the problem of stream composition by providing async initialization, support for both streams1 and streams2, and automatic error propagation.
Node.js developers working with stream-based architectures, such as those building HTTP clients, data pipelines, or custom stream utilities.
Developers choose duplexify for its simplicity in creating duplex streams, async stream attachment capabilities, and seamless compatibility with both legacy and modern stream APIs.
Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows setting readable and writable parts asynchronously with setReadable() and setWritable(), enabling flexible stream initialization as shown in the HTTP request example.
Supports both legacy streams1 and modern streams2 APIs, making it useful for migration projects or mixed codebases without breaking changes.
Automatically destroys both streams and bubbles up events on errors, simplifying error management in complex stream compositions.
Provides a destroy() method for manual stream termination with optional error arguments, allowing precise error emission and cleanup.
Only combines streams without built-in transformation, filtering, or other operations, requiring additional libraries like through2 for data manipulation.
In async mode, writes buffer until the writable stream is set, which can increase memory usage and complexity if streams are attached late or inconsistently.
Automatically destroys both streams on any error, which may be too restrictive for applications needing graceful error recovery or partial stream reuse.