You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
524 B
JavaScript
17 lines
524 B
JavaScript
|
6 years ago
|
'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)
|
||
|
|
}
|