Skip to content
Myr

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 file

Take it

Fix CISindre Sorhusbefore adoptioncfac59f

lines 1–8why, one step back
1#!/usr/bin/env node
2import process from 'node:process';3import {text} from 'node:stream/consumers';4import {getReadStream} from '../helpers/fs.js';56// Every file descriptor is read fully, since exiting with unread data in one of them makes the parent fail with `ECONNRESET` on Linux7const contents = await Promise.all(process.argv.slice(2).map(fdNumber => text(getReadStream(Number(fdNumber)))));8process.stdout.write(contents.join(''));