import { resolve } from 'path' ; import chalk from 'chalk' ; export const getDirPath = ( relPath = '' ) => { return resolve ( __dirname , relPath ) ; } ; export const getCwdPath = ( relPath = '' ) => { return resolve ( process . cwd ( ) , relPath ) ; } ; export const loggerTiming = ( str = '' , start = true ) => { if ( start ) { console . time ( 'Timing' ) ; console . log ( chalk . cyan ( `****** ${ str } START ******` ) ) ; } else { console . log ( chalk . cyan ( `****** ${ str } END ******` ) ) ; console . timeEnd ( 'Timing' ) ; } } ; export const loggerInfo = ( str = '' ) => { console . log ( chalk . green ( `[INFO]： ${ str }` ) ) ; } ; export const loggerWarring = ( str = '' ) => { console . log ( chalk . yellowBright ( `[WARRING]： ${ str }` ) ) ; } ; export const loggerSuccess = ( str = '' ) => { console . log ( chalk . greenBright ( `[SUCCESS]： ${ str }` ) ) ; } ; export const loggerError = ( str = '' ) => { console . log ( chalk . redBright ( `[ERROR]： ${ str }` ) ) ; } ;