Submit
Path:
~
/
/
proc
/
self
/
root
/
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
pacote
/
lib
/
util
/
File Content:
pack-dir.js
'use strict' const BB = require('bluebird') const cacache = require('cacache') const cacheKey = require('./cache-key') const optCheck = require('./opt-check') const packlist = require('npm-packlist') const pipe = BB.promisify(require('mississippi').pipe) const tar = require('tar') module.exports = packDir function packDir (manifest, label, dir, target, opts) { opts = optCheck(opts) const packer = opts.dirPacker ? BB.resolve(opts.dirPacker(manifest, dir)) : mkPacker(dir) if (!opts.cache) { return packer.then(packer => pipe(packer, target)) } else { const cacher = cacache.put.stream( opts.cache, cacheKey('packed-dir', label), opts ).on('integrity', i => { target.emit('integrity', i) }) return packer.then(packer => BB.all([ pipe(packer, cacher), pipe(packer, target) ])) } } function mkPacker (dir) { return packlist({ path: dir }).then(files => { return tar.c({ cwd: dir, gzip: true, portable: true, prefix: 'package/' }, files) }) }
Submit
FILE
FOLDER
Name
Size
Permission
Action
cache-key.js
129 bytes
0644
finished.js
419 bytes
0644
git.js
8350 bytes
0644
opt-check.js
1240 bytes
0644
pack-dir.js
1050 bytes
0644
proclog.js
340 bytes
0644
read-json.js
481 bytes
0644
N4ST4R_ID | Naxtarrr