summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install/action/fetch.js
blob: 5ad34e29dd27efa92b9169d50bc8fde8bcacaa72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict'

const BB = require('bluebird')

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

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