stdin-fds.js
This file
Path
test/fixtures/stdin-fds.js
8 lines · 439 bytes · JavaScript
Last changed by
Fix CISindre Sorhusbefore adoptioncfac59f
History of this fileTake it
123456789#!/usr/bin/env nodeimport process from 'node:process';import {text} from 'node:stream/consumers';import {getReadStream} from '../helpers/fs.js';
// Every file descriptor is read fully, since exiting with unread data in one of them makes the parent fail with `ECONNRESET` on Linuxconst contents = await Promise.all(process.argv.slice(2).map(fdNumber => text(getReadStream(Number(fdNumber)))));process.stdout.write(contents.join(''));