DefinitelyTyped/types/node-cleanup/node-cleanup-tests.ts
2017-08-17 20:45:55 +02:00

14 lines
439 B
TypeScript

import nodeCleanup = require('node-cleanup');
function cleanupHandler(exitCode: number | null, signal: string | null): boolean | undefined {
return true;
}
const stderrMessages = { ctrl_C: 'ctrl_c', uncaughtException: 'UncaughtException' };
nodeCleanup();
nodeCleanup(cleanupHandler);
nodeCleanup(cleanupHandler, undefined);
nodeCleanup(cleanupHandler, stderrMessages);
nodeCleanup(undefined, stderrMessages);
nodeCleanup.uninstall();