MCPcopy Create free account
hub / github.com/nodejs/node / getLoremIpsumStream

Function getLoremIpsumStream

benchmark/readline/readline-iterable.js:56–65  ·  view source on GitHub ↗
(repetitions)

Source from the content-addressed store, hash-verified

54}
55
56function getLoremIpsumStream(repetitions) {
57 const readable = Readable({
58 objectMode: true,
59 });
60 let i = 0;
61 readable._read = () => readable.push(
62 i++ >= repetitions ? null : loremIpsum,
63 );
64 return readable;
65}
66
67async function main({ n, type }) {
68 bench.start();

Callers 1

mainFunction · 0.85

Calls 2

ReadableFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected