How to use the npmlog.disableProgress function in npmlog

To help you get started, we’ve selected a few npmlog 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 graalvm / graaljs / deps / npm / lib / utils / error-handler.js View on Github external
function errorHandler (er) {
  log.disableProgress()
  if (!npm.config || !npm.config.loaded) {
    // logging won't work unless we pretend that it's ready
    er = er || new Error('Exit prior to config file resolving.')
    console.error(er.stack || er.message)
  }

  if (cbCalled) {
    er = er || new Error('Callback called more than once.')
  }

  cbCalled = true
  if (!er) return exit(0)
  if (typeof er === 'string') {
    log.error('', er)
    return exit(1, true)
  } else if (!(er instanceof Error)) {
github graalvm / graaljs / deps / npm / lib / view.js View on Github external
}

    if (msgJson.length === 1) {
      msg = JSON.stringify(msgJson[0], null, 2) + '\n'
    } else if (msgJson.length > 1) {
      msg = JSON.stringify(msgJson, null, 2) + '\n'
    }
  }

  // preserve output symmetry by adding a whitespace-only line at the end if
  // there's one at the beginning
  if (/^\s*\n/.test(msg)) msg += '\n'

  // disable the progress bar entirely, as we can't meaningfully update it if
  // we may have partial lines printed.
  log.disableProgress()

  // print directly to stdout to not unnecessarily add blank lines
  process.stdout.write(msg, () => cb(null, data))
}
function cleanup (data) {
github graalvm / graaljs / deps / npm / lib / adduser.js View on Github external
return cb(new Error(
      'You must compile node with ssl support to use the adduser feature'
    ))
  }

  let registry = npm.config.get('registry')
  const scope = npm.config.get('scope')
  const creds = npm.config.getCredentialsByURI(npm.config.get('registry'))

  if (scope) {
    const scopedRegistry = npm.config.get(scope + ':registry')
    const cliRegistry = npm.config.get('registry', 'cli')
    if (scopedRegistry && !cliRegistry) registry = scopedRegistry
  }

  log.disableProgress()

  let auth
  try {
    auth = require('./auth/' + npm.config.get('auth-type'))
  } catch (e) {
    return cb(new Error('no such auth module'))
  }
  auth.login(creds, registry, scope, function (err, newCreds) {
    if (err) return cb(err)

    npm.config.del('_token', 'user') // prevent legacy pollution
    if (scope) npm.config.set(scope + ':registry', registry, 'user')
    npm.config.setCredentialsByURI(registry, newCreds)
    npm.config.save('user', cb)
  })
}
github othiym23 / packard / src / command / pls.js View on Github external
.then((albums) => {
      log.disableProgress()
      console.log(makePlaylist([...albums].sort(byDate)))
    })
}
github othiym23 / packard / src / command / artists.js View on Github external
function report (roots) {
  log.disableProgress()
  for (let [root, artists] of roots) {
    const sorted = [...artists.values()].sort(bySize)
    if (sorted.length) {
      console.log('\nROOT %s:', root)
      for (let a of sorted) {
        console.log('%s [%sM]', a.name, a.getSize(1024 * 1024))
      }
    }
  }
}
github othiym23 / packard / src / cli.js View on Github external
}).catch((e) => {
  log.disableProgress()
  log.error('packard', e.stack)
})
github hisabimbola / slack-history-export / src / cli.js View on Github external
process.on('exit', () => {
  log.disableProgress()
})
const successCallback = function successCallback () {
github othiym23 / packard / src / command / optimize.js View on Github external
.then((albums) => {
      log.disableProgress()
      calculate([...albums], blockSize, capacity)
    })
}
github othiym23 / packard / src / command / audit.js View on Github external
.then((albums) => {
      log.disableProgress()
      log.silly('audit', 'albums', albums)
      for (let album of albums) {
        const id = album.artist.name + ': ' + album.name + ' /'
        for (let warning of auditAlbum(album)) log.warn('audit', id, warning)
      }
    })
}
github othiym23 / packard / src / command / albums.js View on Github external
const sorted = scanAlbums(roots, progressGroups).then((albums) => {
    log.silly('scanAlbums', 'albums', albums)
    const sorted = [...albums].sort(byDate)
    log.silly('scanAlbums', 'sorted', sorted.map((a) => '[' + a.date + '] ' + a.name))

    log.disableProgress()
    return sorted
  })