fetch.js 524 B

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