VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /proc/self/root/usr/local/lib/node_modules/npm/lib/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/local/lib/node_modules/npm/lib/utils/setup-log.js
// module to set the appropriate log settings based on configs
// returns a boolean to say whether we should enable color on
// stdout or not.
//
// Also (and this is a really inexcusable kludge), we patch the
// log.warn() method so that when we see a peerDep override
// explanation from Arborist, we can replace the object with a
// highly abbreviated explanation of what's being overridden.
const log = require('npmlog')
const { explain } = require('./explain-eresolve.js')

module.exports = (config) => {
  const color = config.get('color')

  const { warn } = log

  const stdoutTTY = process.stdout.isTTY
  const stderrTTY = process.stderr.isTTY
  const dumbTerm = process.env.TERM === 'dumb'
  const stderrNotDumb = stderrTTY && !dumbTerm
  // this logic is duplicated in the config 'color' flattener
  const enableColorStderr = color === 'always' ? true
    : color === false ? false
    : stderrTTY

  const enableColorStdout = color === 'always' ? true
    : color === false ? false
    : stdoutTTY

  log.warn = (heading, ...args) => {
    if (heading === 'ERESOLVE' && args[1] && typeof args[1] === 'object') {
      warn(heading, args[0])
      return warn('', explain(args[1], enableColorStdout, 2))
    }
    return warn(heading, ...args)
  }

  if (config.get('timing') && config.get('loglevel') === 'notice')
    log.level = 'timing'
  else
    log.level = config.get('loglevel')

  log.heading = config.get('heading') || 'npm'

  if (enableColorStderr)
    log.enableColor()
  else
    log.disableColor()

  if (config.get('unicode'))
    log.enableUnicode()
  else
    log.disableUnicode()

  // if it's more than error, don't show progress
  const quiet = log.levels[log.level] > log.levels.error

  if (config.get('progress') && stderrNotDumb && !quiet)
    log.enableProgress()
  else
    log.disableProgress()
}

VaKeR 2022