no1b4me's picture
Upload 5037 files
95f4e64 verified
raw
history blame contribute delete
349 Bytes
export default function onExit(cleanUp) {
// const events = [`exit`, `SIGINT`, `SIGUSR1`, `SIGUSR2`, `uncaughtException`, `SIGTERM`]
for (const event of [
`exit`,
`SIGINT`,
`SIGUSR1`,
`SIGUSR2`,
`uncaughtException`,
`SIGTERM`,
]) {
process.on(event, () => cleanUp(event));
}
}