mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
11 lines
427 B
TypeScript
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");
|