summaryrefslogtreecommitdiff
path: root/tests/unit_node/testdata/child_process_stdio_012.js
blob: e3717f98526e84273df0d246c1912fd3347e99fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import childProcess from "node:child_process";
import process from "node:process";
import * as path from "node:path";
import { fileURLToPath } from "node:url";

const script = path.join(
  path.dirname(fileURLToPath(import.meta.url)),
  "node_modules",
  "foo",
  "index.js",
);

const child = childProcess.spawn(process.execPath, [script], {
  stdio: [0, 1, 2],
});
child.on("close", () => console.log("close"));