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