How to use the consola.wrapConsole function in consola

To help you get started, we’ve selected a few consola examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nuxt / nuxt.js / packages / cli / src / setup.js View on Github external
})

  // Exit process on fatal errors
  /* istanbul ignore next */
  consola.addReporter({
    log (logObj) {
      if (logObj.type === 'fatal') {
        const errorMessage = String(logObj.args[0])
        process.stderr.write(fatalBox(errorMessage))
        exit(1)
      }
    }
  })

  // Wrap all console logs with consola for better DX
  consola.wrapConsole()
}