
Security News
crates.io Ships Security Tab and Tightens Publishing Controls
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.
Concatenate Node JS Streams!
You can concatenate the result of Promises, non async buffers and other streams allowing you to sequence things into an asynchronous Stream.
Example, print the contents of myfileA followed by myfileB, this is
equivalent to using cat(1): cat myfileA myfileB.
var streamCat = require('streamcat');
streamCat([
fs.createReadStream('myfileA'),
fs.createReadStream('myfileB')
]).pipe(process.stdout);
streamCat(listOfStreamsBuffersOrPromises)streamCat will take a list of ReadStreams, Buffers, or Promises
returning a ReadStream or Buffer as its only
argument and returns a ReadStream that will stream the concatenation of each
item in the list.
You can mix Buffer, ReadStream, and Promise usage, in this instance, the String
"Some content" will be streamed between myfileA and myfileB:
streamCat([
fs.createReadStream('myfileA'),
new Buffer("Some content"),
fs.createReadStream('myfileB')
]).pipe(process.stdout);
Example using Promises that has the same result as the above example, the
value in the Promise is resolved asynchronously:
streamCat([
fs.createReadStream('myfileA'),
Promise.resolve(new Buffer("Some content")),
fs.createReadStream('myfileB')
]).pipe(process.stdout);
The streamCat function can take an optional options object as its second
argument.
errorMapperThe errorMapper option allows you to specify a function that can transform
an error from any of the contatenated streams before emitting the error on the
returned stream.
The errorMapper must return an error object.
{
errorMapper: function(error) {
error.message = error.message + ": my custom context";
return error;
}
}
MIT
FAQs
Concatenate ReadStreams and Buffers!
We found that streamcat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.