1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-27 16:10:57 -05:00
denoland-deno/cli/tests/unit_node/testdata/child_process_stdio.js
Marvin Hagemeister 695b5de6cb
fix(node): support passing parent stdio streams (#19171)
This is a bit bare bones but gets `npm-run-all` working. For full stdio
compatibility with node more work is needed which is probably better
done in follow up PRs.

Fixes #19159
2023-05-18 14:02:14 +02:00

15 lines
413 B
JavaScript

import childProcess from "node:child_process";
import process from "node:process";
import * as path from "node:path";
const script = path.join(
path.dirname(path.fromFileUrl(import.meta.url)),
"node_modules",
"foo",
"index.js",
);
const child = childProcess.spawn(process.execPath, [script], {
stdio: [process.stdin, process.stdout, process.stderr],
});
child.on("close", () => console.log("close"));