Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 15, 2024 via pnpm

pump 0.1.1

pipe streams together and close all of them if one of them closes
Package summary
Share
2
issues
1
high severity
license
1
1
low severity
license
1
2
licenses
1
BSD
1
MIT
Package created
14 Aug 2013
Version published
14 Aug 2013
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

2

1 high severity issue

high
Recommendation: Validate that the package complies with your license policy
via: once@1.2.0
Collapse
Expand

1 low severity issue

low
Recommendation: Read and validate the license terms
via: once@1.2.0
Collapse
Expand

Licenses

BSD

Invalid
Not OSI Approved
1 Packages, Including:
once@1.2.0

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
pump@0.1.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of pump 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
once1.2.01.82 kBBSD
prod
1
1

Visualizations

Frequently Asked Questions

What does pump do?

Pump is a small and effective Node.js module that serves the purpose of piping streams together and destroys all of them if one closes. This module resolves the issue in Node.js where using source.pipe(dest), the source won't be destroyed if dest emits close or an error, and it's not possible to provide a callback when the pipe is finished. Pump handles these two issues seamlessly.

How do you use pump?

To incorporate Pump in your Node.js project, you first need to install it using npm by running npm install pump in your terminal. Once you've done this, you can start using Pump in your code by requiring it like this var pump = require('pump'). The basic usage is quite straightforward - you need to pass the streams you wish to pipe together to pump, and optionally add a callback function. Here's a basic example:

var pump = require('pump')
var fs = require('fs')

var source = fs.createReadStream('/dev/random')
var dest = fs.createWriteStream('/dev/null')

pump(source, dest, function(err) {
  console.log('pipe finished', err)
})

setTimeout(function() {
  dest.destroy() // when dest is closed pump will destroy source
}, 1000)

In this example, a source stream is created that reads from '/dev/random' and a destination stream is created to write to '/dev/null'. These streams are piped together using pump, and a callback is provided that logs when the pipe is finished. After 1 second, the destination stream is destroyed, which in turn causes pump to destroy the source stream.

Pump can also be used to pipe more than two streams together as well like this:

var transform = someTransformStream()

pump(source, transform, anotherTransform, dest, function(err) {
  console.log('pipe finished', err)
})

In this case, if any of source, transform, anotherTransform, or dest closes, all of them will be annihilated.

Where are the pump docs?

The complete documentation and information for Pump can be found in its README file in the GitHub repository (git://github.com/mafintosh/pump.git). The README offers a detailed explanation about what the module does, how to use it with code examples, and the problems it can solve. Further information can be accessed through the provided link to the Mississippi Stream Utility Collection, where you can find related and useful stream modules.