Files
scriptc/tests/corpus/2898-child-stdin-spawn-failure.ts
Chris Tateandeuxaristia 5e4b4df1b9 feat(child_process): support writable child stdin (#341)
* feat(child_process): support writable child stdin

- Add nonblocking child stdin writers with lifecycle events and platform-aware backpressure.
- Lower writable streams through the C and LLVM backends while fencing unsupported overloads.
- Add differential, type, diagnostics, and compatibility coverage.

Fixes #311

Co-authored-by: euxaristia <25621994+euxaristia@users.noreply.github.com>

* Reject non-literal spawn options

- Emit a named lowering diagnostic instead of silently dropping variable options.
- Cover two- and three-argument spawn overloads with diagnostic regressions.

Fixes #311

Co-authored-by: euxaristia <25621994+euxaristia@users.noreply.github.com>

---------

Co-authored-by: euxaristia <25621994+euxaristia@users.noreply.github.com>
2026-09-17 07:48:29 -05:00

11 lines
354 B
TypeScript

import { spawn } from "node:child_process";
const child = spawn("definitely-not-a-binary-child-stdin", []);
const input = child.stdin;
if (input === null) throw new Error("missing default stdin pipe");
console.log("initial", input.writable);
child.on("error", (err) => {
console.log("error", (err as NodeJS.ErrnoException).code, input.writable);
});