@quasar/app-vite
Version:
Quasar Framework App CLI with Vite
19 lines (16 loc) • 355 B
JavaScript
import { log } from './logger.js'
export function onShutdown(fn, msg) {
const cleanup = () => {
try {
if (msg) log(msg)
fn()
} finally {
process.exit()
}
}
process.on('exit', cleanup)
process.on('SIGINT', cleanup)
process.on('SIGTERM', cleanup)
process.on('SIGHUP', cleanup)
process.on('SIGBREAK', cleanup)
}