How to use the std-env.debug function in std-env

To help you get started, we’ve selected a few std-env 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 / consola / src / node.js View on Github external
function createConsola () {
  // Log level
  let level = env.debug ? 4 : 3
  if (process.env.CONSOLA_LEVEL) {
    level = parseInt(process.env.CONSOLA_LEVEL) || level
  }

  // Create new consola instance
  const consola = new Consola({
    level,
    reporters: [
      (env.ci || env.test)
        ? new BasicReporter()
        : new FancyReporter()
    ]
  })

  // Expose constructors
  consola.Consola = Consola
github nuxt-community / nuxt-generate-cluster / lib / utils / consola.js View on Github external
import chalk from 'chalk'
import messaging from './messaging'
import { ClusterReporter } from './reporters'

let _consola
if (global.__consolaSet === undefined) {
  _consola = global.consola
  // Delete the global.consola set by consola self
  delete global.consola
}

let consola = global.consola // eslint-disable-line import/no-mutable-exports

if (!consola) {
  consola = _consola.create({
    level: env.debug ? 5 : 3,
    types: {
      ..._consola._types,
      ...{
        cluster: {
          level: 4,
          color: 'blue',
          icon: chalk.magenta(figures.radioOn)
        },
        master: {
          level: 2,
          color: 'blue',
          icon: chalk.cyan(figures.info)
        },
        debug: {
          level: 5,
          color: 'grey'

std-env

Runtime agnostic JS utils

MIT
Latest version published 11 months ago

Package Health Score

79 / 100
Full package analysis

Similar packages