Files
scriptc/tests/corpus/1426-stdin-read.ts
2026-07-22 18:08:04 -05:00

11 lines
427 B
TypeScript

// The stdin slice, read half: the readFileSync(fd) forms over the empty
// closed pipe the harness provides — process.stdin deliberately untouched
// (see 1425's note on Node's non-blocking footgun).
import { readFileSync } from "node:fs";
const text = readFileSync(0, "utf8");
console.log(JSON.stringify(text), text.length);
const bytes = readFileSync(0);
console.log(bytes.length, bytes.byteLength);
console.log("done");