il fallait que sa puisse passer sur un cv
This commit is contained in:
@@ -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 }
|
||||
Reference in New Issue
Block a user