il fallait que sa puisse passer sur un cv

This commit is contained in:
Marc
2022-02-17 14:19:08 +01:00
parent 1edb531e1a
commit 551505c014
37 changed files with 13 additions and 20 deletions
+23
View File
@@ -0,0 +1,23 @@
//@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 }