You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

pump

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pump

pipe streams together and close all of them if one of them closes

3.0.3
latest
Source
npmnpm
Version published
Weekly downloads
52M
-3.74%
Maintainers
1
Weekly downloads
 
Created

What is pump?

The pump npm package is a small node module that pipes streams together and destroys all of them if one of them closes. It is particularly useful for preventing memory leaks when piping together streams and handling errors properly in Node.js applications.

What are pump's main functionalities?

Piping streams together with error handling

This code demonstrates how to use pump to pipe data from a readable stream to a writable stream, such as from a file to another file, with error handling. If an error occurs in any of the streams, pump ensures that all streams are properly closed to prevent memory leaks.

const pump = require('pump');
const fs = require('fs');
const source = fs.createReadStream('/path/to/source');
const destination = fs.createWriteStream('/path/to/dest');
pump(source, destination, function(err) {
  console.log('Pipe finished', err);
});

Other packages similar to pump

Keywords

streams

FAQs

Package last updated on 16 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts