async-exit-hook icon indicating copy to clipboard operation
async-exit-hook copied to clipboard

Run some code when the process exits

Results 11 async-exit-hook issues
Sort by recently updated
recently updated
newest added

This would be useful to control the order of exit hooks execution where required. Use case: if I am using it for shutting down dependant processes gracefully, I am probably...

I think it's mistake because in your example the final `then()` will call arrow function and will return callback but it should call the callback

Let me illustrate the problem with the following code: ```javascript const cluster = require("cluster"); const exitHook = require("async-exit-hook"); function addHook(delay) { exitHook(cb => { console.log("Start " + delay); setTimeout(() =>...

Please, could you provide an example of how use NodeMailer to send an email on Node exit? I can't figure it out how to integrate callback with nodemailer's promise. Thanks.

Hello, it looks like you can bind to both. Is there any particoular reason? Also, would you expose the exit function so that one can eventually calll it manually?

The `runHook` method has no error handling: ```javascript if (err) { // Pass error, calling uncaught exception handlers return hook(err, stepTowardExit); } return hook(stepTowardExit); ``` If a hook throws, then...

When calling exit hook, like so: ```javascript exitHook(cb => { /* do something on exit */ }) ``` `cb` may not be a function depending on how the `async-exit-hook` routine...

callback is always called https://github.com/Tapppi/async-exit-hook/blame/80e692c88e62a88cf5750460ff02c28298e5b09b/readme.md#L60 callback is not always provided https://github.com/Tapppi/async-exit-hook/blob/80e692c88e62a88cf5750460ff02c28298e5b09b/index.js#L39 should be ``` exitHook(callback => { setTimeout(() => { console.log('exiting 3'); if(callback) callback(); }, 1000); }); ```