import chalk from "chalk" ; import util from "util" ; function _log ( prefix , template , ... fmt ) { const formatted = util . format ( template , ... fmt ) ; const clean = prefix . replace ( /\x1b\[\d+m/g , "" ) ; process . stdout . write ( " " . repeat ( 10 - clean . length ) + prefix + " " + formatted + "\n" ) ; } export function log ( template , ... fmt ) { _log ( chalk . grey ( "log ⬤" ) , template , ... fmt ) ; } export function info ( template , ... fmt ) { _log ( chalk . blue ( "info ⬤" ) , template , ... fmt ) ; } export function error ( template , ... fmt ) { _log ( chalk . red ( "error ✖" ) , template , ... fmt ) ; } export function fatal ( template , ... fmt ) { _log ( chalk . red ( "fatal ✖" ) , template , ... fmt ) ; } export function warn ( template , ... fmt ) { _log ( chalk . yellow ( "warn ⚠" ) , template , ... fmt ) ; } export function success ( template , ... fmt ) { _log ( chalk . green ( "success ✓" ) , template , ... fmt ) ; } export default { log , info , error , fatal , warn , success } ;