Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

run another process on 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();
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #run #process #nodejs #process #exit
ADD COMMENT
Topic
Name
6+2 =