h2non / nar

node.js application archive - create self-contained binary like executable applications that are ready to ship and run
MIT License
428 stars 23 forks source link

Handle node process exit in order to clean temporary files #79

Closed h2non closed 10 years ago

h2non commented 10 years ago

Applied for run, extract and install commands

//do something when app is closing
process.on('exit', exitHandler.bind(null,{cleanup:true}));

//catches ctrl+c event
process.on('SIGINT', exitHandler.bind(null, {exit:true}));

//catches uncaught exceptions
process.on('uncaughtException', exitHandler.bind(null, {exit:true}));
h2non commented 10 years ago

Done!