Uruchom inny proces na wyjściu procesowym NodeJS

const spawn = require('child_process').spawn;

process.on('exit', () => {
   const child = spawn('node', ['some_other_script.js'], {
      detached: true,
      stdio: 'ignore'
   });

   child.unref();
});
Emmanuel Mahuni