UNPKG

putout

Version:

🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json

19 lines (13 loc) 344 B
import {red} from './chalk.js'; export const createExit = ({halt, raw, logError}) => (code, e) => { if (!code) return halt(0); if (!e) return halt(code); const message = raw ? e : red(`🐊 ${e.message || e}`); logError(message); halt(code); return { exited: true, }; };