Jalankan proses lain di Nodejs Process Exit

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