• File: fetch.js
  • Full Path: /home6/laduliya/test.mydthpay.com/node_modules/npm/lib/install/action/fetch.js
  • Date Modified: 10/26/1985 11:45 AM
  • File size: 524 bytes
  • MIME-type: text/plain
  • Charset: utf-8
'use strict'

const BB = require('bluebird')

const finished = BB.promisify(require('mississippi').finished)
const npmConfig = require('../../config/figgy-config.js')
const packageId = require('../../utils/package-id.js')
const pacote = require('pacote')

module.exports = fetch
function fetch (staging, pkg, log, next) {
  log.silly('fetch', packageId(pkg))
  const opts = npmConfig({integrity: pkg.package._integrity})
  return finished(pacote.tarball.stream(pkg.package._requested, opts))
    .then(() => next(), next)
}