Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
stream-collect
Advanced tools
Collects a readable streams data as a string, buffer or, for object streams, an array.
npm install stream-collect
collect.Collect(options)
Create a pass through stream with a collect()
method and collect
event.
const { Collect } = require('stream-collect');
const file = fs.createReadableStream('myfile');
// Collect using a promise
file.pipe(new Collect())
.collect()
.then(buffer => { /* use contents */ });
// Collect using an event
file.pipe(new Collect())
.on('collect', buffer => { /* use contents */ });
// Collect as a string rather than a buffer
file.pipe(new Collect({ encoding: 'utf-8' }))
.collect()
.then(string => { /* use contents */ });
// Collect an object stream
file
.pipe(new Transform({
readableObjectMode: true,
transform(chunk, encoding, callback) {
chunk.toString().split('').forEach(char = this.push(char));
callback();
}
})
.pipe(new Collect())
.on('collect', array => { /* -> array of characters */ });
collect(stream, [encoding], [cb])
Collect a streams contents returning a promise or callback.
const collect = require('stream-collect');
const file = fs.createReadableStream('myfile');
// Collect using a promise
collect(file)
.then(fileContents => { /* use contents */ });
// Collect using a callback
collect(file, (error, fileContents) => { /* use contents */ });
// Specify an encoding
collect(file, 'base64')
.then(fileContents => { /* use contents */ });
collect.CollectObjects()
A Collect
stream with objectMode
set to true.
collect.addToStream(stream)
Augment any stream with a collect
event.
Returns the augmented stream.
FAQs
Collects the output of a stream
The npm package stream-collect receives a total of 46 weekly downloads. As such, stream-collect popularity was classified as not popular.
We found that stream-collect 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 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.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.