Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.


Node.js pre-exit scripts

node v10.22.1
version: 2.0.0
// Add pre-exit script process.on ('exit', code => { console.log (`Whoa! Exit code ${code}, cleaning up...`); // i.e. close database }); // Add another for fun process.on ('exit', code => { if (code > 0) { console.log ('Hmm something went wrong'); } else { console.log ('And done!'); } }); console.log ('App ready.'); console.log ('Doing app stuff...');

no comments

    sign in to comment