finally-provider
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Finally Provider

Register functions for execution at a later time.

Installation

npm i finally-provider

Usage

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

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i finally-provider

    Weekly Downloads

    2

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    5.43 kB

    Total Files

    8

    Last publish

    Collaborators

    • jawis