1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00
denoland-deno/tests/registry/npm/@denotest/child-process-fork/1.0.0/index.js

21 lines
470 B
JavaScript
Raw Normal View History

const path = require("path");
function childProcessFork(path) {
const command = new Deno.Command(Deno.execPath(), {
args: ["run", "-A", path],
env: {
"DENO_DONT_USE_INTERNAL_NODE_COMPAT_STATE": Deno[Deno.internal].core.ops.op_npm_process_state(),
}
});
const child = command.spawn();
child.status.then(() => {
console.log("Done.");
});
}
module.exports = {
run() {
childProcessFork(path.join(__dirname, "forked_path.js"));
}
};