import chalk from 'chalk' ; type Color = chalk . Chalk | chalk . Chalk [ ] ; export function log ( message , color = chalk . white , [ before , after ] = [ true , true ] ) { const colors = Array . isArray ( color ) ? color : [ color ] ; const coloredMessage = colors . reduce ( ( acc , colorize ) => { return colorize ( acc ) ; } , message ) ; const args = [ ] ; if ( before ) args . push ( '\n' ) ; args . push ( coloredMessage ) ; if ( after ) args . push ( '\n' ) ; console . info ( ... args ) ; }