• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict'
2
3const BB = require('bluebird')
4
5const finished = BB.promisify(require('mississippi').finished)
6const npmConfig = require('../../config/figgy-config.js')
7const packageId = require('../../utils/package-id.js')
8const pacote = require('pacote')
9
10module.exports = fetch
11function fetch (staging, pkg, log, next) {
12  log.silly('fetch', packageId(pkg))
13  const opts = npmConfig({integrity: pkg.package._integrity})
14  return finished(pacote.tarball.stream(pkg.package._requested, opts))
15    .then(() => next(), next)
16}
17