ipc-print-many-each.js
This file
Path
test/fixtures/ipc-print-many-each.js
14 lines · 460 bytes · JavaScript
Last changed by
Require Node.js 22 (#1243)Sindre Sorhusbefore adoption04b4454
History of this fileTake it
123456789101112131415#!/usr/bin/env nodeimport {argv} from 'node:process';import {getEachMessage} from '../../index.js';
const count = Number(argv[2]);
for (let index = 0; index < count; index += 1) { // eslint-disable-next-line no-await-in-loop, no-unreachable-loop for await (const message of getEachMessage()) { console.log(message); // eslint-disable-next-line unicorn/no-break-in-nested-loop -- breaks only the inner loop, the outer loop must continue break; }}