NodeJs on Exit Event

import process from 'process';

process.on('exit', (code) => {
  console.log(`About to exit with code: ${code}`);
});
Frightened Fox