M
process.finalization.registerBeforeExit
History
Added in: v22.5.0
v22.5.0
Introduced in: v0.10.0
v0.10.0
process.finalization.registerBeforeExit(ref, callback): void
Stability: 1.1Active Development
Attributes
This function behaves exactly like the register, except that the callback will be called
when the process emits the beforeExit event if ref object was not garbage collected.
Be aware that all limitations applied to the beforeExit event are also applied to the callback function,
this means that there is a possibility that the callback will not be called under special circumstances.