Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.217.80
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
node-minipass-collect /
Delete
Unzip
Name
Size
Permission
Date
Action
README.md
1.47
KB
-rw-r--r--
2022-12-03 17:25
copyright
2.85
KB
-rw-r--r--
2022-12-03 17:20
Save
Rename
# minipass-collect A Minipass stream that collects all the data into a single chunk Note that this buffers ALL data written to it, so it's only good for situations where you are sure the entire stream fits in memory. Note: this is primarily useful for the `Collect.PassThrough` class, since Minipass streams already have a `.collect()` method which returns a promise that resolves to the array of chunks, and a `.concat()` method that returns the data concatenated into a single Buffer or String. ## USAGE ```js const Collect = require('minipass-collect') const collector = new Collect() collector.on('data', allTheData => { console.log('all the data!', allTheData) }) someSourceOfData.pipe(collector) // note that you can also simply do: someSourceOfData.pipe(new Minipass()).concat().then(data => ...) // or even, if someSourceOfData is a Minipass: someSourceOfData.concat().then(data => ...) // but you might prefer to have it stream-shaped rather than // Promise-shaped in some scenarios. ``` If you want to collect the data, but _also_ act as a passthrough stream, then use `Collect.PassThrough` instead (for example to memoize streaming responses), and listen on the `collect` event. ```js const Collect = require('minipass-collect') const collector = new Collect.PassThrough() collector.on('collect', allTheData => { console.log('all the data!', allTheData) }) someSourceOfData.pipe(collector).pipe(someOtherStream) ``` All [minipass options](http://npm.im/minipass) are supported.