27 lines
422 B
JavaScript
27 lines
422 B
JavaScript
//@ts-check
|
|
const { exec, fork } = require('child_process');
|
|
/**
|
|
* @param {string} path
|
|
* @deprecated
|
|
*/
|
|
function hookTo(path) {
|
|
exec(`node ${path}`)
|
|
}
|
|
|
|
/**
|
|
* @param {string} path
|
|
*/
|
|
async function fHook(path) {
|
|
const child = fork(path)
|
|
return new Promise((res, rej) => {
|
|
child.on('exit', () => {
|
|
res()
|
|
})
|
|
})
|
|
}
|
|
|
|
function rHook(path) {
|
|
|
|
}
|
|
|
|
module.exports = { hookTo, fHook } |