A Node.js module that pipes streams together and automatically destroys all streams if one closes or errors.
pump is a Node.js module that pipes multiple streams together while ensuring proper cleanup. It automatically destroys all streams in the pipeline if any one stream closes or emits an error, preventing resource leaks and simplifying error handling.
Node.js developers working with stream-based data processing, file operations, or network communication who need reliable stream management.
Developers choose pump over native `stream.pipe()` for its automatic cleanup, built-in error handling, and callback support, reducing boilerplate and preventing common stream-related bugs.
pipe streams together and close all of them if one of them closes
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
If any stream in the pipeline closes or errors, pump destroys all streams to prevent resource leaks, directly addressing the limitation of native `stream.pipe()` as stated in the README.
Provides an optional callback to notify when piping finishes, including error handling, which simplifies asynchronous flow control compared to manual event listening.
Supports piping more than two streams together in a chain, enabling complex data workflows without extra boilerplate for connection management.
Attaches error handlers to streams internally to prevent uncaught exceptions, reducing the risk of crashes in stream-based applications.
Pump attaches internal error handlers, which can conflict with custom error handling logic if developers need fine-grained control over individual stream errors, as noted in the README about error handling.
For modern Node.js projects with `stream.pipeline` available, using pump adds an unnecessary external dependency without significant additional benefits.
As a small utility, it lacks advanced stream features like backpressure management or integration with newer Node.js stream APIs, focusing only on basic piping and cleanup.