archiver
Advanced tools
Comparing version 4.0.2 to 5.0.0
## Changelog | ||
**5.0.0** - <small>_July 22, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/4.0.2...5.0.0) | ||
* breaking: absolute path glob patterns are no longer supported: use cwd option instead. | ||
* Replaced glob with readdir-glob to be memory efficient (#433) @Yqnn | ||
* Bump zip-stream from 4.0.0 to 4.0.2 (#431) @dependabot | ||
* Bump zip-stream from 3.0.1 to 4.0.0 (#430) @dependabot | ||
* Bump mocha from 6.2.3 to 8.0.1 (#424) @dependabot | ||
* Bump tar from 4.4.13 to 6.0.2 (#426) @dependabot | ||
* Bump tar-stream from 2.1.2 to 2.1.3 (#427) @dependabot | ||
* Bump rimraf from 2.7.1 to 3.0.2 (#425) @dependabot | ||
* Bump actions/setup-node from v1 to v2.1.0 (#428) @dependabot | ||
* Bump actions/checkout from v1 to v2.3.1 (#429) @dependabot | ||
* Bump lodash from 4.17.15 to 4.17.19 (#423) @dependabot | ||
**4.0.2** - <small>_July 11, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/4.0.1...4.0.2) | ||
@@ -4,0 +18,0 @@ |
@@ -9,3 +9,3 @@ /** | ||
var fs = require('fs'); | ||
var glob = require('glob'); | ||
var glob = require('readdir-glob'); | ||
var async = require('async'); | ||
@@ -393,4 +393,11 @@ var path = require('path'); | ||
Archiver.prototype._onQueueTask = function(task, callback) { | ||
var fullCallback = () => { | ||
if(task.data.callback) { | ||
task.data.callback(); | ||
} | ||
callback(); | ||
} | ||
if (this._state.finalizing || this._state.finalized || this._state.aborted) { | ||
callback(); | ||
fullCallback(); | ||
return; | ||
@@ -400,3 +407,3 @@ } | ||
this._task = task; | ||
this._moduleAppend(task.source, task.data, callback); | ||
this._moduleAppend(task.source, task.data, fullCallback); | ||
}; | ||
@@ -629,5 +636,4 @@ | ||
var globOptions = { | ||
stat: false, | ||
dot: true, | ||
cwd: dirpath | ||
stat: true, | ||
dot: true | ||
}; | ||
@@ -645,7 +651,10 @@ | ||
function onGlobMatch(match){ | ||
globber.pause(); | ||
var ignoreMatch = false; | ||
var entryData = Object.assign({}, data); | ||
entryData.name = match; | ||
entryData.name = match.relative; | ||
entryData.prefix = destpath; | ||
match = globber._makeAbs(match); | ||
entryData.stats = match.stat; | ||
entryData.callback = globber.resume.bind(globber); | ||
@@ -668,9 +677,10 @@ try { | ||
if (ignoreMatch) { | ||
globber.resume(); | ||
return; | ||
} | ||
this._append(match, entryData); | ||
this._append(match.absolute, entryData); | ||
} | ||
var globber = glob('**', globOptions); | ||
var globber = glob(dirpath, globOptions); | ||
globber.on('error', onGlobError.bind(this)); | ||
@@ -715,4 +725,4 @@ globber.on('match', onGlobMatch.bind(this)); | ||
* | ||
* @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/node-glob#glob-primer} to match. | ||
* @param {Object} options See [node-glob]{@link https://github.com/isaacs/node-glob#options}. | ||
* @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/minimatch} to match. | ||
* @param {Object} options See [node-glob]{@link https://github.com/yqnn/node-readdir-glob#options}. | ||
* @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and | ||
@@ -726,3 +736,4 @@ * [TarEntryData]{@link TarEntryData}. | ||
options = util.defaults(options, { | ||
stat: false | ||
stat: true, | ||
pattern: pattern | ||
}); | ||
@@ -740,13 +751,12 @@ | ||
function onGlobMatch(match){ | ||
globber.pause(); | ||
var entryData = Object.assign({}, data); | ||
entryData.callback = globber.resume.bind(globber); | ||
entryData.stats = match.stat; | ||
entryData.name = match.relative; | ||
if (options.cwd) { | ||
entryData.name = match; | ||
match = globber._makeAbs(match); | ||
} | ||
this._append(match, entryData); | ||
this._append(match.absolute, entryData); | ||
} | ||
var globber = glob(pattern, options); | ||
var globber = glob(options.cwd || '.', options); | ||
globber.on('error', onGlobError.bind(this)); | ||
@@ -753,0 +763,0 @@ globber.on('match', onGlobMatch.bind(this)); |
{ | ||
"name": "archiver", | ||
"version": "4.0.2", | ||
"version": "5.0.0", | ||
"description": "a streaming interface for archive generation", | ||
@@ -24,3 +24,3 @@ "homepage": "https://github.com/archiverjs/node-archiver", | ||
"engines": { | ||
"node": ">= 8" | ||
"node": ">= 10" | ||
}, | ||
@@ -36,6 +36,6 @@ "scripts": { | ||
"buffer-crc32": "^0.2.1", | ||
"glob": "^7.1.6", | ||
"readable-stream": "^3.6.0", | ||
"readdir-glob": "^1.0.0", | ||
"tar-stream": "^2.1.2", | ||
"zip-stream": "^3.0.1" | ||
"zip-stream": "^4.0.0" | ||
}, | ||
@@ -47,6 +47,6 @@ "devDependencies": { | ||
"mkdirp": "^1.0.4", | ||
"mocha": "^6.2.3", | ||
"rimraf": "^2.7.1", | ||
"mocha": "^8.0.1", | ||
"rimraf": "^3.0.2", | ||
"stream-bench": "^0.1.2", | ||
"tar": "^4.4.13", | ||
"tar": "^6.0.2", | ||
"yauzl": "^2.9.0" | ||
@@ -53,0 +53,0 @@ }, |
48750
1257
+ Addedreaddir-glob@^1.0.0
+ Addedarchiver-utils@3.0.4(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcompress-commons@4.1.2(transitive)
+ Addedcrc-32@1.2.2(transitive)
+ Addedcrc32-stream@4.0.3(transitive)
+ Addedminimatch@5.1.6(transitive)
+ Addedreaddir-glob@1.1.3(transitive)
+ Addedzip-stream@4.1.1(transitive)
- Removedglob@^7.1.6
- Removedcompress-commons@3.0.0(transitive)
- Removedcrc@3.8.0(transitive)
- Removedcrc32-stream@3.0.1(transitive)
- Removedzip-stream@3.0.1(transitive)
Updatedzip-stream@^4.0.0