@alwatr/exit-hook
Version:
A utility for registering exit handlers in Node.js.
16 lines • 387 B
TypeScript
/**
* Add a callback function to be called when the process is exiting.
*
* @param callback The callback function to be called when the process is exiting.
*
* @example
* ```typescript
* const saveAllData = () => {
* // save all data
* };
*
* existHook(saveAllData);
* ```
*/
export declare function exitHook(callback: () => void): void;
//# sourceMappingURL=main.d.ts.map