Function addExitCallback

  • Add a callback function to be called upon process exit or death.

    Parameters

    • callback: ExitCallback

      Typed to block async functions. Async functions will not work for 'exit' events, triggered from process.exit(), but will work with other events this catches. If you wish to perform async functions have this callback call an async function but remember it won't be awaited if the signal is 'exit'.

    Returns ExitCallback

    The callback itself for chaining purposes.