finally-provider
v0.38.0
Published
Register functions for execution at a later time.
Readme
Finally Provider
Register functions for execution at a later time.
Installation
npm i finally-providerUsage
Provides the ability to register functions, that should be executed before shutdown.
const finalProv = new FinallyProvider({
onError: console.log,
});
//Execute where needed
finalProv.finally(() => {
console.log("Clean up stuff here.");
});
//Execute just before shutdown
finalProv.runFinally().then(() => {
console.log("Ready to exit.");
});Known issues
Related work
License
MIT
