I'd like to run a process once another process exits.
For example, if I'm running a node JS file and I hit CTRL + C, it should close the current file and run another process from another JS file
Something like that (PSEUDO-CODE):
process.on('exit', () => {
console.log("exiting")
}).then( //I am conscious it's wrong to put like that
//open another js file and run this process
);