How to use the npmlog.newGroup 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 lerna / lerna / core / command / index.js View on Github external
configureLogging() {
    const { loglevel } = this.options;

    if (loglevel) {
      log.level = loglevel;
    }

    // handle log.success()
    log.addLevel("success", 3001, { fg: "green", bold: true });

    // create logger that subclasses use
    this.logger = log.newGroup(this.name);

    // emit all buffered logs at configured level and higher
    log.resume();
  }
github othiym23 / packard / src / utils / zip.js View on Github external
export function unpack (archivePath, progressGroups, targetPath) {
  validate('SOS', arguments)

  const name = basename(archivePath)
  let gauge = progressGroups.get(name)
  if (!gauge) {
    gauge = log.newGroup(name)
    progressGroups.set(name, gauge)
  }

  const unpacked = join(targetPath, createHash('sha1').update(archivePath).digest('hex'))

  return Bluebird.join(
    mkdirp(unpacked),
    stat(archivePath)
  ).spread((p, stats) => new Bluebird((resolve, reject) => {
    gauge.verbose('unzip', 'unpacking', archivePath, 'to', unpacked)
    // openZip can't be promisified because the object stream it yields doesn't
    // start paused.
    openZip(archivePath, { autoClose: false }, (err, archive) => {
      if (err) return reject(err)

      let entryCount = archive.entryCount
github othiym23 / packard / src / metadata / mp3 / reader.js View on Github external
export default function reader (info, progressGroups, onFinish, onError) {
  const path = info.path
  const name = basename(path)
  let gauge = progressGroups.get(name)
  if (!gauge) {
    gauge = log.newGroup(name)
    progressGroups.set(name, gauge)
  }

  const streamData = info.streamData = {}
  const tags = info.tags = {}
  const musicbrainzTags = info.musicbrainzTags = {}
  const throughWatcher = gauge.newStream('Tags: ' + name, info.stats.size)

  let textFrames = []
  const rawTags = new Map()
  const parser = mm(
    throughWatcher,
    { duration: true, fileSize: info.stats.size },
    (err) => {
      // you'll get back a blank track if there's no metadata at all
      if (err && err.message !== 'Could not find metadata header') {
github lerna / lerna / core / command / index.js View on Github external
configureLogging() {
    const { loglevel } = this.options;

    if (loglevel) {
      log.level = loglevel;
    }

    // handle log.success()
    log.addLevel("success", 3001, { fg: "green", bold: true });

    // create logger that subclasses use
    Object.defineProperty(this, "logger", {
      value: log.newGroup(this.name),
    });

    // emit all buffered logs at configured level and higher
    log.resume();
  }
github othiym23 / packard / src / command / inspect.js View on Github external
return Bluebird.map(files, (path) => {
    progressGroups.set(basename(path), log.newGroup(path))
    return scan({ path }, progressGroups)
  }).then((track) => {
    log.disableProgress()
github liquidg3 / altair / node_modules / npm / lib / install.js View on Github external
}, function () {
    if (linkTodoList.length === 0) return cb()
    pruneTree(self.idealTree)
    self.differences.length = 0
    Array.prototype.push.apply(self.differences, linkTodoList)
    diffTrees(self.currentTree, self.idealTree, self.differences, log.newGroup('d2'), cb)
  })
}
github liquidg3 / altair / node_modules / npm / lib / utils / tar.js View on Github external
readPackageTree(folder, iferr(cb, function (tree) {
        recalculateMetadata(tree, log.newGroup('pack:' + pkg), iferr(cb, function () {
          pack_(tarball, folder, tree, flattenTree(tree), pkg, cb)
        }))
      }))
    }
github liquidg3 / altair / node_modules / npm / lib / install.js View on Github external
Installer.prototype.loadCurrentTree = function (cb) {
  validate('F', arguments)
  log.silly('install', 'loadCurrentTree')
  var todo = []
  if (this.global) {
    todo.push([this, this.readGlobalPackageData])
  } else {
    todo.push([this, this.readLocalPackageData])
  }
  todo.push(
    [this, this.normalizeTree, log.newGroup('normalizeTree')])
  chain(todo, cb)
}
github othiym23 / packard / src / command / unpack.js View on Github external
    files.forEach((f) => groups.set(f, log.newGroup('process: ' + f)))
    return files