cancelable-pump
Advanced tools
Weekly downloads
Readme
Cancelable pump
const {createReadStream, createWriteStream} = require('cancelable-pump');
const cancelablePump = require('cancelable-pump');
cancelablePump(createReadStream('1GB-file.txt'), createWriteStream('dest0'), () => {
statSync('dest0').size; //=> 1000000000;
});
const cancel = cancelablePump(createReadStream('1GB-file.txt'), createWriteStream('dest1'), () => {
statSync('dest1').size; //=> 263192576, or something else smaller than 1000000000
});
setTimeout(() => {
cancel();
}, 1000);
npm install cancelable-pump
const cancelablePump = require('cancelable-pump');
stream0, stream1, stream2, ...: Stream
callback: Function
Return: Function
streams: Array<Stream>
callback: Function
Return: Function
The API is almost the same as pump
's. The only difference is cancelable-pump returns a function to destroy all streams without passing any errors to the callback.
const cancel = cancelablePump([src, transform, anotherTransform, dest], err => {
err; //=> undefined
});
cancel();
ISC License © 2017 - 2018 Shinnosuke Watanabe
FAQs
Cancelable `pump`
The npm package cancelable-pump receives a total of 307 weekly downloads. As such, cancelable-pump popularity was classified as not popular.
We found that cancelable-pump demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.