mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
81812bad7b
PR-URL: https://github.com/nodejs/node/pull/41225 Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
12 lines
289 B
JavaScript
12 lines
289 B
JavaScript
import { mustCall } from '../common/index.mjs';
|
|
import { fork } from 'child_process';
|
|
|
|
if (process.argv[2] === 'child') {
|
|
process.disconnect();
|
|
} else {
|
|
const child = fork(new URL(import.meta.url), ['child']);
|
|
|
|
child.on('disconnect', mustCall());
|
|
child.once('exit', mustCall());
|
|
}
|