@quasar/app-webpack
Version:
Quasar Framework App CLI with Webpack
19 lines (16 loc) • 381 B
JavaScript
const { log } = require('./logger.js')
module.exports.onShutdown = 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)
}