Check if tor is running
function isTorRunning(){ console.log('Checking if Tor is running...'); var cp = require('child_process'); cp.exec('ps aux | grep tor', (err, stdout) => { if(err){ console.log('Error finding Tor'); throw err; } if(stdout.includes('tor')){ console.log('Tor is running'); }else{ console.log('Tor is not running. Please start Tor'); process.exit(1); } }); }