'use strict' const fetchPackument = require('./lib/fetch').packument const optCheck = require('./lib/util/opt-check') const pinflight = require('promise-inflight') const npa = require('npm-package-arg') module.exports = packument function packument (spec, opts) { opts = optCheck(opts) spec = npa(spec, opts.where) const label = [ spec.name, spec.saveSpec || spec.fetchSpec, spec.type, opts.cache, opts.registry, opts.scope ].join(':') const startTime = Date.now() return pinflight(label, () => { return fetchPackument(spec, opts) }).then(p => { const elapsedTime = Date.now() - startTime opts.log.silly('pacote', `${spec.registry ? 'registry' : spec.type} packument for ${spec.name}@${spec.saveSpec || spec.fetchSpec} fetched in ${elapsedTime}ms`) return p }) }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
lib | Folder | 0755 |
|
|
node_modules | Folder | 0755 |
|
|
CHANGELOG.md | File | 43.39 KB | 0644 |
|
LICENSE | File | 1.08 KB | 0644 |
|
README.md | File | 9.6 KB | 0644 |
|
extract.js | File | 2.99 KB | 0644 |
|
index.js | File | 262 B | 0644 |
|
manifest.js | File | 1.12 KB | 0644 |
|
package.json | File | 13.42 KB | 0644 |
|
packument.js | File | 822 B | 0644 |
|
prefetch.js | File | 1.93 KB | 0644 |
|
tarball.js | File | 1.97 KB | 0644 |
|