how can I use a callback tor a promise correctly to get the result from a node exec in the condole.log()
function?
import { exec } from 'child_process';
const check = () => {
exec(`...`, (err, stdout) => {
if (err) {
return false
}
else {
return true
}
})
}
console.log(check()) // getting undefined
I've tried using .on('exit')
but none worked... would love to get some help here. THANKS!!