Exécutez un autre processus sur la sortie du processus 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