Execute a function right before the process, or the browser's tab, is about to exit.
npm install when-exit