How to use the npmlog.newItem 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 cplusplus / LEWG / scripts / main.js View on Github external
function elaborateIssue(issue) {
  let progress = log.newItem('LEWG' + issue.id + ': ' + issue.summary, 3);
  function completeWork(x) {
    progress.completeWork(1);
    return x;
  }
  let commentsP = isocppIssues.getComments(issue.id).then(completeWork);
  let ccNamesP = isocppIssues.getUserRealNames(issue.cc.filter(addr => {
    // Don't mention the LEWG chair as someone to invite.
    return !addr.startsWith('jyasskin@') &&
      !addr.startsWith('titus@') &&
      // And don't list the presenter separately.
      addr != issue.assigned_to;
  }));
  ccNamesP = ccNamesP.then(completeWork);
  let presenterNameP;
  if (issue.assigned_to === 'lib-ext@lists.isocpp.org') {
    presenterNameP = Promise.resolve(undefined);
github devinhalladay / devinhalladay.com / node_modules / node-sass / scripts / install.js View on Github external
.on('response', function(response) {
      var length = parseInt(response.headers['content-length'], 10);
      var progress = log.newItem('', length);

      if (successful(response)) {
        response.pipe(fs.createWriteStream(dest));
      }

      // The `progress` is true by default. However if it has not
      // been explicitly set it's `undefined` which is considered
      // as far as npm is concerned.
      if (process.env.npm_config_progress === 'true') {
        log.enableProgress();

        response.on('data', function(chunk) {
          progress.completeWork(chunk.length);
        })
        .on('end', progress.finish);
      }
github swc-project / node-swc / scripts / install.js View on Github external
}).on("response", function(response) {
      var length = parseInt(response.headers["content-length"], 10);
      var progress = log.newItem("", length);

      // The `progress` is true by default. However if it has not
      // been explicitly set it's `undefined` which is considered
      // as far as npm is concerned.
      if (process.env.npm_config_progress === "true") {
        log.enableProgress();

        response
          .on("data", function(chunk) {
            progress.completeWork(chunk.length);
          })
          .on("end", progress.finish);
      }
    });
  } catch (err) {
github EightShapes / contrast-grid / node_modules / node-sass / scripts / install.js View on Github external
.on('response', function(response) {
      var length = parseInt(response.headers['content-length'], 10);
      var progress = log.newItem('', length);

      if (successful(response)) {
        response.pipe(fs.createWriteStream(dest));
      }

      // The `progress` is true by default. However if it has not
      // been explicitly set it's `undefined` which is considered
      // as far as npm is concerned.
      if (process.env.npm_config_progress === 'true') {
        log.enableProgress();

        response.on('data', function(chunk) {
          progress.completeWork(chunk.length);
        })
        .on('end', progress.finish);
      }
github graalvm / graaljs / deps / npm / lib / doctor / get-latest-npm-version.js View on Github external
function getLatestNpmVersion (cb) {
  var tracker = log.newItem('getLatestNpmVersion', 1)
  tracker.info('getLatestNpmVersion', 'Getting npm package information')
  fetchPackageMetadata('npm@latest', '.', {}, function (err, d) {
    tracker.finish()
    if (err) { return cb(err) }
    cb(null, d.version)
  })
}
github muammar / mkchromecast / nodejs / node-7.8.0 / lib / node_modules / npm / lib / doctor / get-git-path.js View on Github external
function getGitPath (cb) {
  var tracker = log.newItem('getGitPath', 1)
  tracker.info('getGitPath', 'Finding git in your PATH')
  which('git', function (err, path) {
    tracker.finish()
    cb(err, path)
  })
}
github graalvm / graaljs / deps / npm / lib / doctor / check-files-permission.js View on Github external
getUid(npm.config.get('user'), npm.config.get('group'), function (e, uid, gid) {
    var tracker = log.newItem('checkFilePermissions', 1)
    if (e) {
      tracker.finish()
      tracker.warn('checkFilePermissions', 'Error looking up user and group:', e)
      return cb(e)
    }
    tracker.info('checkFilePermissions', 'Building file list of ' + root)
    fileCompletion(root, '.', Infinity, function (e, files) {
      if (e) {
        tracker.warn('checkFilePermissions', 'Error building file list:', e)
        tracker.finish()
        return cb(e)
      }
      tracker.addWork(files.length)
      tracker.completeWork(1)
      chain(files.map(andCheckFile), function (er) {
        tracker.finish()
github graalvm / graaljs / deps / npm / lib / token.js View on Github external
function rm (args) {
  if (args.length === 0) {
    throw new Error('npm token revoke ')
  }
  const conf = config()
  const toRemove = []
  const progress = log.newItem('removing tokens', toRemove.length)
  progress.info('token', 'getting existing list')
  return pulseTillDone.withPromise(profile.listTokens(conf).then((tokens) => {
    args.forEach((id) => {
      const matches = tokens.filter((token) => token.key.indexOf(id) === 0)
      if (matches.length === 1) {
        toRemove.push(matches[0].key)
      } else if (matches.length > 1) {
        throw new Error(`Token ID "${id}" was ambiguous, a new token may have been created since you last ran \`npm-profile token list\`.`)
      } else {
        const tokenMatches = tokens.filter((token) => id.indexOf(token.token) === 0)
        if (tokenMatches === 0) {
          throw new Error(`Unknown token id or value "${id}".`)
        }
        toRemove.push(id)
      }
    })