putout
Version:
🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json
18 lines (13 loc) • 418 B
JavaScript
import chalk from '../lib/cli/chalk.mjs';
export const onDebuggerExit = ({log, process, inspector}) => {
const {pid} = process;
process.once('exit', (code) => {
if (code !== 1)
return;
if (!inspector.url())
return;
inspector.close();
log(chalk.bgBlueBright(`node --inspect: 'kill ${pid}'`));
process.kill(pid);
});
};