
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
accumulate-stream
Advanced tools
accumulate-stream
Transform stream that accumulates and emits data upon events
$ npm i -S accumulate-stream
$ yarn add accumulate-stream
import { createReadStream } from 'fs';
import { once } from 'events';
import { AccumulateStream } from 'accumulate-stream';
(async (): void => {
// file.txt: (2kb)
// streams are awesome.
// streams are awesome.
// ... ...
const readable = createReadStream('file.txt');
const accumulator = new AccumulateStream({ size: '1kb', phrase: 'awesome' });
readable.pipe(accumulateStream);
// will be emitted every 1kb and 2 writes
accumulator.on('chunk', ({ buffer }) => console.log(`emitted every chunk write - ${buffer.toString()}`));
accumulator.on('size', ({ buffer }) => console.log(`emitted every 1kb of chunks - ${buffer.toString()}`));
accumulator.on('phrase', ({ buffer }) =>
console.log(`emitted whenever "stream" phrase is detected in chunk - ${buffer.toString()}`),
);
accumulator.on('data', ({ buffer }) => console.log(`emitted whenever one of the conditions is met - ${buffer.toString()}`));
await once(accumulator, 'data');
console.log(accumulator.getBuffer().toString()); // streams are awesome.
})();
// [TBD]
FAQs
Transform stream that accumulates and emits data upon events
The npm package accumulate-stream receives a total of 4,379 weekly downloads. As such, accumulate-stream popularity was classified as popular.
We found that accumulate-stream 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.