Files
Linux.js---javascript-OS/rootfs overrides/chibrax/hook.js
T
2021-11-29 14:08:48 +01:00

23 lines
395 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()
})
})
}
module.exports = { hookTo, fHook }