(repetitions)
| 54 | } |
| 55 | |
| 56 | function 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 | |
| 67 | async function main({ n, type }) { |
| 68 | bench.start(); |