mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
feat(npm): functionality to support child_process.fork (#15891)
This commit is contained in:
parent
23125b275f
commit
d677ba67f5
18 changed files with 232 additions and 21 deletions
3
cli/tests/testdata/npm/registry/@denotest/child-process-fork/1.0.0/forked_path.js
vendored
Normal file
3
cli/tests/testdata/npm/registry/@denotest/child-process-fork/1.0.0/forked_path.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const chalk = require("chalk");
|
||||
|
||||
console.log(typeof chalk.green);
|
19
cli/tests/testdata/npm/registry/@denotest/child-process-fork/1.0.0/index.js
vendored
Normal file
19
cli/tests/testdata/npm/registry/@denotest/child-process-fork/1.0.0/index.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
const path = require("path");
|
||||
|
||||
function childProcessFork(path) {
|
||||
const p = Deno.run({
|
||||
cmd: [Deno.execPath(), "run", "--unstable", "-A", path],
|
||||
env: {
|
||||
"DENO_DONT_USE_INTERNAL_NODE_COMPAT_STATE": Deno.core.ops.op_npm_process_state(),
|
||||
}
|
||||
});
|
||||
p.status().then(() => {
|
||||
console.log("Done.");
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
run() {
|
||||
childProcessFork(path.join(__dirname, "forked_path.js"));
|
||||
}
|
||||
};
|
4
cli/tests/testdata/npm/registry/@denotest/child-process-fork/1.0.0/package.json
vendored
Normal file
4
cli/tests/testdata/npm/registry/@denotest/child-process-fork/1.0.0/package.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "@denotest/child-process-fork",
|
||||
"version": "1.0.0"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue