
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
stream-recorder
Advanced tools

A Duplex stream which collects all chunks passed through.
npm install stream-recorder --save
Then pipe through a recorder instance and retrieve the buffer:
var Recorder = require('stream-recorder'),
streamFromArray = require('stream-from-array'), // npm install stream-from-array
input = ['foo', 'bar'];
streamFromArray(input)
.pipe(Recorder(function(buffer){
// it's not an object stream, so buffer is a node buffer
console.log(buffer.toString()); // output: foobar
}))
.resume(); // switch into flowing-mode (!)
Gulp files are vinyl files:
npm install vinyl
var streamFromValue = require('stream-from-value');
var File = require('vinyl');
var helloFile = new File({
cwd: '/',
base: '/hello/',
path: '/hello/world.js',
contents: new Buffer('console.log("Hello world!");')
});
describe('yourAwsomeGulpPlugin', function() {
it('should process gulp (vinyl) files', function(done) {
streamFromValue.obj(helloFile)
.pipe(yourAwsomeGulpPlugin())
.pipe(Recorder.obj(function(buffer) {
// it's an object stream, so buffer is an array - of gulp files
console.log(buffer[0].contents); // dunno what yourAwsomeGulpPlugin does :-)
done();
}))
.resume(); // switch into flowing-mode (!)
});
});
StreamRecorder are Transform streams.
Object passed through new stream.Transform([options])Function (buffer) This Callback is called during the finish event of StreamRecorderNote: The new operator can be omitted.
objectMode it is the array of JavaScript values (number | object | string | ... ) passed throughstrings and buffers passed throughA convenience wrapper for new StreamRecorder({objectMode: true, ...}, finishCallback).
Copyright (c) 2014 Michael Mayer
Licensed under the MIT license.
FAQs
A Duplex stream which collects all chunks passed through
The npm package stream-recorder receives a total of 3 weekly downloads. As such, stream-recorder popularity was classified as not popular.
We found that stream-recorder 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.