initial commit
This commit is contained in:
228
node_modules/archiver/CHANGELOG.md
generated
vendored
Normal file
228
node_modules/archiver/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,228 @@
|
||||
## Changelog
|
||||
|
||||
**5.3.1** - <small>_April 15, 2022_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/5.3.0...5.3.1)
|
||||
|
||||
Maintenance
|
||||
|
||||
- Test against node v16 @ctalkington (#545)
|
||||
|
||||
Dependency updates
|
||||
|
||||
- Bump mocha from 8.3.0 to 9.0.2 @dependabot (#526)
|
||||
- Bump actions/setup-node from 2.1.5 to 2.2.0 @dependabot (#525)
|
||||
- Bump jsdoc from 3.6.6 to 3.6.7 @dependabot (#516)
|
||||
- Bump lodash from 4.17.19 to 4.17.21 @dependabot (#514)
|
||||
- Bump chai from 4.3.3 to 4.3.4 @dependabot (#508)
|
||||
- Bump actions/setup-node from 2.2.0 to 2.3.0 @dependabot (#528)
|
||||
- Bump mocha from 9.0.2 to 9.1.0 @dependabot (#544)
|
||||
- Bump async from 3.2.0 to 3.2.1 @dependabot (#538)
|
||||
- Bump actions/checkout from 2.3.4 to 3.0.1 @dependabot (#586)
|
||||
- Bump actions/setup-node from 2.3.0 to 3.1.1 @dependabot (#585)
|
||||
- Bump jsdoc from 3.6.7 to 3.6.10 @dependabot (#566)
|
||||
- Bump async from 3.2.1 to 3.2.3 @dependabot (#562)
|
||||
- Bump mocha from 9.1.0 to 9.2.2 @dependabot (#580)
|
||||
- Bump tar from 6.1.0 to 6.1.11 @dependabot (#546)
|
||||
- Bump chai from 4.3.4 to 4.3.6 @dependabot (#568)
|
||||
|
||||
|
||||
**5.3.0** - <small>_March 7, 2021_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/5.2.0...5.3.0)
|
||||
|
||||
Maintenance
|
||||
|
||||
- Bump chai from 4.3.0 to 4.3.3 (#505)
|
||||
- Bump zip-stream from 4.0.4 to 4.1.0 (#504)
|
||||
- Bump mocha from 8.2.1 to 8.3.0 (#499)
|
||||
- Bump actions/setup-node from v2.1.4 to v2.1.5 (#500)
|
||||
- Bump tar from 6.0.5 to 6.1.0 (#487)
|
||||
- Bump chai from 4.2.0 to 4.3.0 (#496)
|
||||
- Bump tar-stream from 2.1.4 to 2.2.0 (#485)
|
||||
- Bump actions/setup-node from v2.1.3 to v2.1.4 (#483)
|
||||
- Update progress example (#384)
|
||||
|
||||
**5.2.0** - <small>_January 6, 2021_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/5.1.0...5.2.0)
|
||||
|
||||
Features
|
||||
|
||||
- Finalize should always return a promise (#480)
|
||||
|
||||
Maintenance
|
||||
|
||||
- Fix finalize method jsdoc return type (#482)
|
||||
- Bump actions/setup-node from v2.1.2 to v2.1.3 (#479)
|
||||
- Update README.md (#478)
|
||||
|
||||
**5.1.0** - <small>_November 19, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/5.0.2...5.1.0)
|
||||
|
||||
Features
|
||||
|
||||
- Add mode parameter to symlink (#469)
|
||||
- Add isRegisteredFormat method (#462)
|
||||
|
||||
Bug Fixes
|
||||
|
||||
- Fix glob() `options` parameter's link (#453)
|
||||
|
||||
Maintenance
|
||||
|
||||
- Bump archiver-jsdoc-theme from 1.1.1 to 1.1.3 (#472)
|
||||
- Bump zip-stream from 4.0.2 to 4.0.4 (#473)
|
||||
- Bump jsdoc from 3.6.5 to 3.6.6 (#452)
|
||||
- Bump readdir-glob from 1.0.0 to 1.1.1 (#460)
|
||||
- Bump mocha from 8.1.3 to 8.2.1 (#465)
|
||||
- Bump actions/setup-node from v2.1.1 to v2.1.2 (#459)
|
||||
- Bump actions/checkout from v2.3.2 to v2.3.4 (#466)
|
||||
|
||||
**5.0.2** - <small>_September 11, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/5.0.1...5.0.2)
|
||||
|
||||
Maintenance
|
||||
|
||||
* Force bump tar-stream from 2.1.2 to 2.1.4 (#450)
|
||||
|
||||
**5.0.1** - <small>_September 10, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/5.0.0...5.0.1)
|
||||
|
||||
Maintenance
|
||||
|
||||
- Bump tar-stream from 2.1.3 to 2.1.4 (#448)
|
||||
- Update docs (#441)
|
||||
- Bump mocha from 8.1.1 to 8.1.3 (#444)
|
||||
- Bump tar from 6.0.2 to 6.0.5 (#439)
|
||||
- Bump mocha from 8.1.0 to 8.1.1 (#437)
|
||||
- Bump actions/checkout from v2.3.1 to v2.3.2 (#438)
|
||||
- Bump mocha from 8.0.1 to 8.1.0 (#436)
|
||||
- Bump actions/setup-node from v2.1.0 to v2.1.1 (#432)
|
||||
- Bump jsdoc from 3.6.4 to 3.6.5 (#434)
|
||||
|
||||
**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)
|
||||
|
||||
- update to async@^3.2.0 (#420)
|
||||
|
||||
**4.0.1** - <small>_April 14, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/4.0.0...4.0.1)
|
||||
|
||||
- update to zip-stream@^3.0.1
|
||||
|
||||
**4.0.0** - <small>_April 14, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.1.1...4.0.0)
|
||||
|
||||
- breaking: slowly catch up with node LTS, remove support for versions under 8.
|
||||
- update multiple deps.
|
||||
- fix for a hang with _statQueue (#388)
|
||||
|
||||
**3.1.1** - <small>_August 2, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.1.0...3.1.1)
|
||||
|
||||
- update zip-stream to v2.1.2
|
||||
|
||||
**3.1.0** - <small>_August 2, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.3...3.1.0)
|
||||
|
||||
- update zip-stream to v2.1.0
|
||||
|
||||
**3.0.3** - <small>_July 19, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.2...3.0.3)
|
||||
|
||||
- test: now targeting node v12
|
||||
- other: update zip-stream@2.0.0
|
||||
|
||||
**3.0.2** - <small>_July 19, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.1...3.0.2)
|
||||
|
||||
- other: update dependencies
|
||||
|
||||
**3.0.1** - <small>_July 19, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.0...3.0.1)
|
||||
|
||||
- other: update dependencies
|
||||
- docs: now deployed using netlify
|
||||
|
||||
**3.0.0** - <small>_August 22, 2018_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.1.1...3.0.0)
|
||||
|
||||
- breaking: follow node LTS, remove support for versions under 6. (#339)
|
||||
- bugfix: use stats in tar.js and core.js (#326)
|
||||
- other: update to archiver-utils@2 and zip-stream@2
|
||||
- other: remove lodash npm module usage (#335, #339)
|
||||
- other: Avoid using deprecated Buffer constructor (#312)
|
||||
- other: Remove unnecessary return and fix indentation (#297)
|
||||
- test: now targeting node v10 (#320)
|
||||
|
||||
**2.1.1** — <small>_January 10, 2018_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.1.0...2.1.1)
|
||||
|
||||
- bugfix: fix relative symlink paths (#293)
|
||||
- other: coding style fixes (#294)
|
||||
|
||||
**2.1.0** — <small>_October 12, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.3...2.1.0)
|
||||
|
||||
- refactor: `directory` now uses glob behind the scenes. should fix some directory recursion issues. (#267, #275)
|
||||
- docs: more info in quick start. (#284)
|
||||
|
||||
**2.0.3** — <small>_August 25, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.2...2.0.3)
|
||||
|
||||
- bugfix: revert #261 due to potential issues with editing entryData in special cases.
|
||||
- bugfix: add var to entryData in glob callback (#273)
|
||||
|
||||
**2.0.2** — <small>_August 25, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.1...2.0.2)
|
||||
|
||||
- docs: fix changelog date.
|
||||
|
||||
**2.0.1** — <small>_August 25, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.0...2.0.1)
|
||||
|
||||
- bugfix: add const to entryData in glob callback (#261)
|
||||
- other: coding style fixes (#263)
|
||||
|
||||
**2.0.0** — <small>_July 5, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.3.0...2.0.0)
|
||||
|
||||
- feature: support for symlinks. (#228)
|
||||
- feature: support for promises on `finalize`. (#248)
|
||||
- feature: addition of `symlink` method for programmatically creating symlinks within an archive.
|
||||
- change: emit `warning` instead of `error` when stat fails and the process can still continue.
|
||||
- change: errors and warnings now contain extended data (where available) and have standardized error codes (#256)
|
||||
- change: removal of deprecated `bulk` functionality. (#249)
|
||||
- change: removal of internal `_entries` property in favor of `progress` event. (#247)
|
||||
- change: support for node v4.0+ only. node v0.10 and v0.12 support has been dropped. (#241)
|
||||
|
||||
**1.3.0** — <small>_December 13, 2016_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.2.0...1.3.0)
|
||||
|
||||
- improve `directory` and `glob` methods to use events rather than callbacks. (#203)
|
||||
- fix bulk warning spam (#208)
|
||||
- updated mocha (#205)
|
||||
|
||||
**1.2.0** — <small>_November 2, 2016_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.1.0...1.2.0)
|
||||
|
||||
- Add a `process.emitWarning` for `deprecated` (#202)
|
||||
|
||||
**1.1.0** — <small>_August 29, 2016_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.0.1...1.1.0)
|
||||
|
||||
- minor doc fixes.
|
||||
- bump deps to ensure latest versions are used.
|
||||
|
||||
**1.0.1** — <small>_July 27, 2016_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.0.0...1.0.1)
|
||||
|
||||
- minor doc fixes.
|
||||
- dependencies upgraded.
|
||||
|
||||
**1.0.0** — <small>_April 5, 2016_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/0.21.0...1.0.0)
|
||||
|
||||
- version unification across many archiver packages.
|
||||
- dependencies upgraded and now using semver caret (^).
|
||||
|
||||
**0.21.0** — <small>_December 21, 2015_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/0.20.0...0.21.0)
|
||||
|
||||
- core: add support for `entry.prefix`. update some internals to use it.
|
||||
- core(glob): when setting `options.cwd` get an absolute path to the file and use the relative path for `entry.name`. #173
|
||||
- core(bulk): soft-deprecation of `bulk` feature. will remain for time being with no new features or support.
|
||||
- docs: initial jsdoc for core. http://archiverjs.com/docs
|
||||
- tests: restructure a bit.
|
||||
|
||||
**0.20.0** — <small>_November 30, 2015_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/0.19.0...0.20.0)
|
||||
|
||||
- simpler path normalization as path.join was a bit restrictive. #162
|
||||
- move utils to separate module to DRY.
|
||||
|
||||
[Release Archive](https://github.com/archiverjs/node-archiver/releases)
|
||||
22
node_modules/archiver/LICENSE
generated
vendored
Normal file
22
node_modules/archiver/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
94
node_modules/archiver/README.md
generated
vendored
Normal file
94
node_modules/archiver/README.md
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
# Archiver
|
||||
|
||||
A streaming interface for archive generation
|
||||
|
||||
Visit the [API documentation](https://www.archiverjs.com/) for a list of all methods available.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install archiver --save
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
```js
|
||||
// require modules
|
||||
const fs = require('fs');
|
||||
const archiver = require('archiver');
|
||||
|
||||
// create a file to stream archive data to.
|
||||
const output = fs.createWriteStream(__dirname + '/example.zip');
|
||||
const archive = archiver('zip', {
|
||||
zlib: { level: 9 } // Sets the compression level.
|
||||
});
|
||||
|
||||
// listen for all archive data to be written
|
||||
// 'close' event is fired only when a file descriptor is involved
|
||||
output.on('close', function() {
|
||||
console.log(archive.pointer() + ' total bytes');
|
||||
console.log('archiver has been finalized and the output file descriptor has closed.');
|
||||
});
|
||||
|
||||
// This event is fired when the data source is drained no matter what was the data source.
|
||||
// It is not part of this library but rather from the NodeJS Stream API.
|
||||
// @see: https://nodejs.org/api/stream.html#stream_event_end
|
||||
output.on('end', function() {
|
||||
console.log('Data has been drained');
|
||||
});
|
||||
|
||||
// good practice to catch warnings (ie stat failures and other non-blocking errors)
|
||||
archive.on('warning', function(err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
// log warning
|
||||
} else {
|
||||
// throw error
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
|
||||
// good practice to catch this error explicitly
|
||||
archive.on('error', function(err) {
|
||||
throw err;
|
||||
});
|
||||
|
||||
// pipe archive data to the file
|
||||
archive.pipe(output);
|
||||
|
||||
// append a file from stream
|
||||
const file1 = __dirname + '/file1.txt';
|
||||
archive.append(fs.createReadStream(file1), { name: 'file1.txt' });
|
||||
|
||||
// append a file from string
|
||||
archive.append('string cheese!', { name: 'file2.txt' });
|
||||
|
||||
// append a file from buffer
|
||||
const buffer3 = Buffer.from('buff it!');
|
||||
archive.append(buffer3, { name: 'file3.txt' });
|
||||
|
||||
// append a file
|
||||
archive.file('file1.txt', { name: 'file4.txt' });
|
||||
|
||||
// append files from a sub-directory and naming it `new-subdir` within the archive
|
||||
archive.directory('subdir/', 'new-subdir');
|
||||
|
||||
// append files from a sub-directory, putting its contents at the root of archive
|
||||
archive.directory('subdir/', false);
|
||||
|
||||
// append files from a glob pattern
|
||||
archive.glob('file*.txt', {cwd:__dirname});
|
||||
|
||||
// finalize the archive (ie we are done appending files but streams have to finish yet)
|
||||
// 'close', 'end' or 'finish' may be fired right after calling this method so register to them beforehand
|
||||
archive.finalize();
|
||||
```
|
||||
|
||||
## Formats
|
||||
|
||||
Archiver ships with out of the box support for TAR and ZIP archives.
|
||||
|
||||
You can register additional formats with `registerFormat`.
|
||||
|
||||
You can check if format already exists before to register a new one with `isRegisteredFormat`.
|
||||
|
||||
_Formats will be changing in the future to implement a middleware approach._
|
||||
84
node_modules/archiver/index.js
generated
vendored
Normal file
84
node_modules/archiver/index.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Archiver Vending
|
||||
*
|
||||
* @ignore
|
||||
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||
*/
|
||||
var Archiver = require('./lib/core');
|
||||
|
||||
var formats = {};
|
||||
|
||||
/**
|
||||
* Dispenses a new Archiver instance.
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} format The archive format to use.
|
||||
* @param {Object} options See [Archiver]{@link Archiver}
|
||||
* @return {Archiver}
|
||||
*/
|
||||
var vending = function(format, options) {
|
||||
return vending.create(format, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new Archiver instance.
|
||||
*
|
||||
* @param {String} format The archive format to use.
|
||||
* @param {Object} options See [Archiver]{@link Archiver}
|
||||
* @return {Archiver}
|
||||
*/
|
||||
vending.create = function(format, options) {
|
||||
if (formats[format]) {
|
||||
var instance = new Archiver(format, options);
|
||||
instance.setFormat(format);
|
||||
instance.setModule(new formats[format](options));
|
||||
|
||||
return instance;
|
||||
} else {
|
||||
throw new Error('create(' + format + '): format not registered');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Registers a format for use with archiver.
|
||||
*
|
||||
* @param {String} format The name of the format.
|
||||
* @param {Function} module The function for archiver to interact with.
|
||||
* @return void
|
||||
*/
|
||||
vending.registerFormat = function(format, module) {
|
||||
if (formats[format]) {
|
||||
throw new Error('register(' + format + '): format already registered');
|
||||
}
|
||||
|
||||
if (typeof module !== 'function') {
|
||||
throw new Error('register(' + format + '): format module invalid');
|
||||
}
|
||||
|
||||
if (typeof module.prototype.append !== 'function' || typeof module.prototype.finalize !== 'function') {
|
||||
throw new Error('register(' + format + '): format module missing methods');
|
||||
}
|
||||
|
||||
formats[format] = module;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if the format is already registered.
|
||||
*
|
||||
* @param {String} format the name of the format.
|
||||
* @return boolean
|
||||
*/
|
||||
vending.isRegisteredFormat = function (format) {
|
||||
if (formats[format]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
vending.registerFormat('zip', require('./lib/plugins/zip'));
|
||||
vending.registerFormat('tar', require('./lib/plugins/tar'));
|
||||
vending.registerFormat('json', require('./lib/plugins/json'));
|
||||
|
||||
module.exports = vending;
|
||||
974
node_modules/archiver/lib/core.js
generated
vendored
Normal file
974
node_modules/archiver/lib/core.js
generated
vendored
Normal file
@@ -0,0 +1,974 @@
|
||||
/**
|
||||
* Archiver Core
|
||||
*
|
||||
* @ignore
|
||||
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||
*/
|
||||
var fs = require('fs');
|
||||
var glob = require('readdir-glob');
|
||||
var async = require('async');
|
||||
var path = require('path');
|
||||
var util = require('archiver-utils');
|
||||
|
||||
var inherits = require('util').inherits;
|
||||
var ArchiverError = require('./error');
|
||||
var Transform = require('readable-stream').Transform;
|
||||
|
||||
var win32 = process.platform === 'win32';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {String} format The archive format to use.
|
||||
* @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}.
|
||||
*/
|
||||
var Archiver = function(format, options) {
|
||||
if (!(this instanceof Archiver)) {
|
||||
return new Archiver(format, options);
|
||||
}
|
||||
|
||||
if (typeof format !== 'string') {
|
||||
options = format;
|
||||
format = 'zip';
|
||||
}
|
||||
|
||||
options = this.options = util.defaults(options, {
|
||||
highWaterMark: 1024 * 1024,
|
||||
statConcurrency: 4
|
||||
});
|
||||
|
||||
Transform.call(this, options);
|
||||
|
||||
this._format = false;
|
||||
this._module = false;
|
||||
this._pending = 0;
|
||||
this._pointer = 0;
|
||||
|
||||
this._entriesCount = 0;
|
||||
this._entriesProcessedCount = 0;
|
||||
this._fsEntriesTotalBytes = 0;
|
||||
this._fsEntriesProcessedBytes = 0;
|
||||
|
||||
this._queue = async.queue(this._onQueueTask.bind(this), 1);
|
||||
this._queue.drain(this._onQueueDrain.bind(this));
|
||||
|
||||
this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency);
|
||||
this._statQueue.drain(this._onQueueDrain.bind(this));
|
||||
|
||||
this._state = {
|
||||
aborted: false,
|
||||
finalize: false,
|
||||
finalizing: false,
|
||||
finalized: false,
|
||||
modulePiped: false
|
||||
};
|
||||
|
||||
this._streams = [];
|
||||
};
|
||||
|
||||
inherits(Archiver, Transform);
|
||||
|
||||
/**
|
||||
* Internal logic for `abort`.
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._abort = function() {
|
||||
this._state.aborted = true;
|
||||
this._queue.kill();
|
||||
this._statQueue.kill();
|
||||
|
||||
if (this._queue.idle()) {
|
||||
this._shutdown();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal helper for appending files.
|
||||
*
|
||||
* @private
|
||||
* @param {String} filepath The source filepath.
|
||||
* @param {EntryData} data The entry data.
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._append = function(filepath, data) {
|
||||
data = data || {};
|
||||
|
||||
var task = {
|
||||
source: null,
|
||||
filepath: filepath
|
||||
};
|
||||
|
||||
if (!data.name) {
|
||||
data.name = filepath;
|
||||
}
|
||||
|
||||
data.sourcePath = filepath;
|
||||
task.data = data;
|
||||
this._entriesCount++;
|
||||
|
||||
if (data.stats && data.stats instanceof fs.Stats) {
|
||||
task = this._updateQueueTaskWithStats(task, data.stats);
|
||||
if (task) {
|
||||
if (data.stats.size) {
|
||||
this._fsEntriesTotalBytes += data.stats.size;
|
||||
}
|
||||
|
||||
this._queue.push(task);
|
||||
}
|
||||
} else {
|
||||
this._statQueue.push(task);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal logic for `finalize`.
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._finalize = function() {
|
||||
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._state.finalizing = true;
|
||||
|
||||
this._moduleFinalize();
|
||||
|
||||
this._state.finalizing = false;
|
||||
this._state.finalized = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks the various state variables to determine if we can `finalize`.
|
||||
*
|
||||
* @private
|
||||
* @return {Boolean}
|
||||
*/
|
||||
Archiver.prototype._maybeFinalize = function() {
|
||||
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
|
||||
this._finalize();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends an entry to the module.
|
||||
*
|
||||
* @private
|
||||
* @fires Archiver#entry
|
||||
* @param {(Buffer|Stream)} source
|
||||
* @param {EntryData} data
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._moduleAppend = function(source, data, callback) {
|
||||
if (this._state.aborted) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
this._module.append(source, data, function(err) {
|
||||
this._task = null;
|
||||
|
||||
if (this._state.aborted) {
|
||||
this._shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
this.emit('error', err);
|
||||
setImmediate(callback);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when the entry's input has been processed and appended to the archive.
|
||||
*
|
||||
* @event Archiver#entry
|
||||
* @type {EntryData}
|
||||
*/
|
||||
this.emit('entry', data);
|
||||
this._entriesProcessedCount++;
|
||||
|
||||
if (data.stats && data.stats.size) {
|
||||
this._fsEntriesProcessedBytes += data.stats.size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @event Archiver#progress
|
||||
* @type {ProgressData}
|
||||
*/
|
||||
this.emit('progress', {
|
||||
entries: {
|
||||
total: this._entriesCount,
|
||||
processed: this._entriesProcessedCount
|
||||
},
|
||||
fs: {
|
||||
totalBytes: this._fsEntriesTotalBytes,
|
||||
processedBytes: this._fsEntriesProcessedBytes
|
||||
}
|
||||
});
|
||||
|
||||
setImmediate(callback);
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Finalizes the module.
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._moduleFinalize = function() {
|
||||
if (typeof this._module.finalize === 'function') {
|
||||
this._module.finalize();
|
||||
} else if (typeof this._module.end === 'function') {
|
||||
this._module.end();
|
||||
} else {
|
||||
this.emit('error', new ArchiverError('NOENDMETHOD'));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Pipes the module to our internal stream with error bubbling.
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._modulePipe = function() {
|
||||
this._module.on('error', this._onModuleError.bind(this));
|
||||
this._module.pipe(this);
|
||||
this._state.modulePiped = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines if the current module supports a defined feature.
|
||||
*
|
||||
* @private
|
||||
* @param {String} key
|
||||
* @return {Boolean}
|
||||
*/
|
||||
Archiver.prototype._moduleSupports = function(key) {
|
||||
if (!this._module.supports || !this._module.supports[key]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this._module.supports[key];
|
||||
};
|
||||
|
||||
/**
|
||||
* Unpipes the module from our internal stream.
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._moduleUnpipe = function() {
|
||||
this._module.unpipe(this);
|
||||
this._state.modulePiped = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalizes entry data with fallbacks for key properties.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} data
|
||||
* @param {fs.Stats} stats
|
||||
* @return {Object}
|
||||
*/
|
||||
Archiver.prototype._normalizeEntryData = function(data, stats) {
|
||||
data = util.defaults(data, {
|
||||
type: 'file',
|
||||
name: null,
|
||||
date: null,
|
||||
mode: null,
|
||||
prefix: null,
|
||||
sourcePath: null,
|
||||
stats: false
|
||||
});
|
||||
|
||||
if (stats && data.stats === false) {
|
||||
data.stats = stats;
|
||||
}
|
||||
|
||||
var isDir = data.type === 'directory';
|
||||
|
||||
if (data.name) {
|
||||
if (typeof data.prefix === 'string' && '' !== data.prefix) {
|
||||
data.name = data.prefix + '/' + data.name;
|
||||
data.prefix = null;
|
||||
}
|
||||
|
||||
data.name = util.sanitizePath(data.name);
|
||||
|
||||
if (data.type !== 'symlink' && data.name.slice(-1) === '/') {
|
||||
isDir = true;
|
||||
data.type = 'directory';
|
||||
} else if (isDir) {
|
||||
data.name += '/';
|
||||
}
|
||||
}
|
||||
|
||||
// 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644
|
||||
if (typeof data.mode === 'number') {
|
||||
if (win32) {
|
||||
data.mode &= 511;
|
||||
} else {
|
||||
data.mode &= 4095
|
||||
}
|
||||
} else if (data.stats && data.mode === null) {
|
||||
if (win32) {
|
||||
data.mode = data.stats.mode & 511;
|
||||
} else {
|
||||
data.mode = data.stats.mode & 4095;
|
||||
}
|
||||
|
||||
// stat isn't reliable on windows; force 0755 for dir
|
||||
if (win32 && isDir) {
|
||||
data.mode = 493;
|
||||
}
|
||||
} else if (data.mode === null) {
|
||||
data.mode = isDir ? 493 : 420;
|
||||
}
|
||||
|
||||
if (data.stats && data.date === null) {
|
||||
data.date = data.stats.mtime;
|
||||
} else {
|
||||
data.date = util.dateify(data.date);
|
||||
}
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Error listener that re-emits error on to our internal stream.
|
||||
*
|
||||
* @private
|
||||
* @param {Error} err
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._onModuleError = function(err) {
|
||||
/**
|
||||
* @event Archiver#error
|
||||
* @type {ErrorData}
|
||||
*/
|
||||
this.emit('error', err);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks the various state variables after queue has drained to determine if
|
||||
* we need to `finalize`.
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._onQueueDrain = function() {
|
||||
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
|
||||
this._finalize();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends each queue task to the module.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} task
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
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) {
|
||||
fullCallback();
|
||||
return;
|
||||
}
|
||||
|
||||
this._task = task;
|
||||
this._moduleAppend(task.source, task.data, fullCallback);
|
||||
};
|
||||
|
||||
/**
|
||||
* Performs a file stat and reinjects the task back into the queue.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} task
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._onStatQueueTask = function(task, callback) {
|
||||
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
fs.lstat(task.filepath, function(err, stats) {
|
||||
if (this._state.aborted) {
|
||||
setImmediate(callback);
|
||||
return;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
this._entriesCount--;
|
||||
|
||||
/**
|
||||
* @event Archiver#warning
|
||||
* @type {ErrorData}
|
||||
*/
|
||||
this.emit('warning', err);
|
||||
setImmediate(callback);
|
||||
return;
|
||||
}
|
||||
|
||||
task = this._updateQueueTaskWithStats(task, stats);
|
||||
|
||||
if (task) {
|
||||
if (stats.size) {
|
||||
this._fsEntriesTotalBytes += stats.size;
|
||||
}
|
||||
|
||||
this._queue.push(task);
|
||||
}
|
||||
|
||||
setImmediate(callback);
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Unpipes the module and ends our internal stream.
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._shutdown = function() {
|
||||
this._moduleUnpipe();
|
||||
this.end();
|
||||
};
|
||||
|
||||
/**
|
||||
* Tracks the bytes emitted by our internal stream.
|
||||
*
|
||||
* @private
|
||||
* @param {Buffer} chunk
|
||||
* @param {String} encoding
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
Archiver.prototype._transform = function(chunk, encoding, callback) {
|
||||
if (chunk) {
|
||||
this._pointer += chunk.length;
|
||||
}
|
||||
|
||||
callback(null, chunk);
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates and normalizes a queue task using stats data.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} task
|
||||
* @param {fs.Stats} stats
|
||||
* @return {Object}
|
||||
*/
|
||||
Archiver.prototype._updateQueueTaskWithStats = function(task, stats) {
|
||||
if (stats.isFile()) {
|
||||
task.data.type = 'file';
|
||||
task.data.sourceType = 'stream';
|
||||
task.source = util.lazyReadStream(task.filepath);
|
||||
} else if (stats.isDirectory() && this._moduleSupports('directory')) {
|
||||
task.data.name = util.trailingSlashIt(task.data.name);
|
||||
task.data.type = 'directory';
|
||||
task.data.sourcePath = util.trailingSlashIt(task.filepath);
|
||||
task.data.sourceType = 'buffer';
|
||||
task.source = Buffer.concat([]);
|
||||
} else if (stats.isSymbolicLink() && this._moduleSupports('symlink')) {
|
||||
var linkPath = fs.readlinkSync(task.filepath);
|
||||
var dirName = path.dirname(task.filepath);
|
||||
task.data.type = 'symlink';
|
||||
task.data.linkname = path.relative(dirName, path.resolve(dirName, linkPath));
|
||||
task.data.sourceType = 'buffer';
|
||||
task.source = Buffer.concat([]);
|
||||
} else {
|
||||
if (stats.isDirectory()) {
|
||||
this.emit('warning', new ArchiverError('DIRECTORYNOTSUPPORTED', task.data));
|
||||
} else if (stats.isSymbolicLink()) {
|
||||
this.emit('warning', new ArchiverError('SYMLINKNOTSUPPORTED', task.data));
|
||||
} else {
|
||||
this.emit('warning', new ArchiverError('ENTRYNOTSUPPORTED', task.data));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
task.data = this._normalizeEntryData(task.data, stats);
|
||||
|
||||
return task;
|
||||
};
|
||||
|
||||
/**
|
||||
* Aborts the archiving process, taking a best-effort approach, by:
|
||||
*
|
||||
* - removing any pending queue tasks
|
||||
* - allowing any active queue workers to finish
|
||||
* - detaching internal module pipes
|
||||
* - ending both sides of the Transform stream
|
||||
*
|
||||
* It will NOT drain any remaining sources.
|
||||
*
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.abort = function() {
|
||||
if (this._state.aborted || this._state.finalized) {
|
||||
return this;
|
||||
}
|
||||
|
||||
this._abort();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends an input source (text string, buffer, or stream) to the instance.
|
||||
*
|
||||
* When the instance has received, processed, and emitted the input, the `entry`
|
||||
* event is fired.
|
||||
*
|
||||
* @fires Archiver#entry
|
||||
* @param {(Buffer|Stream|String)} source The input source.
|
||||
* @param {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}.
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.append = function(source, data) {
|
||||
if (this._state.finalize || this._state.aborted) {
|
||||
this.emit('error', new ArchiverError('QUEUECLOSED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
data = this._normalizeEntryData(data);
|
||||
|
||||
if (typeof data.name !== 'string' || data.name.length === 0) {
|
||||
this.emit('error', new ArchiverError('ENTRYNAMEREQUIRED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (data.type === 'directory' && !this._moduleSupports('directory')) {
|
||||
this.emit('error', new ArchiverError('DIRECTORYNOTSUPPORTED', { name: data.name }));
|
||||
return this;
|
||||
}
|
||||
|
||||
source = util.normalizeInputSource(source);
|
||||
|
||||
if (Buffer.isBuffer(source)) {
|
||||
data.sourceType = 'buffer';
|
||||
} else if (util.isStream(source)) {
|
||||
data.sourceType = 'stream';
|
||||
} else {
|
||||
this.emit('error', new ArchiverError('INPUTSTEAMBUFFERREQUIRED', { name: data.name }));
|
||||
return this;
|
||||
}
|
||||
|
||||
this._entriesCount++;
|
||||
this._queue.push({
|
||||
data: data,
|
||||
source: source
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends a directory and its files, recursively, given its dirpath.
|
||||
*
|
||||
* @param {String} dirpath The source directory path.
|
||||
* @param {String} destpath The destination path within the archive.
|
||||
* @param {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and
|
||||
* [TarEntryData]{@link TarEntryData}.
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.directory = function(dirpath, destpath, data) {
|
||||
if (this._state.finalize || this._state.aborted) {
|
||||
this.emit('error', new ArchiverError('QUEUECLOSED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (typeof dirpath !== 'string' || dirpath.length === 0) {
|
||||
this.emit('error', new ArchiverError('DIRECTORYDIRPATHREQUIRED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
this._pending++;
|
||||
|
||||
if (destpath === false) {
|
||||
destpath = '';
|
||||
} else if (typeof destpath !== 'string'){
|
||||
destpath = dirpath;
|
||||
}
|
||||
|
||||
var dataFunction = false;
|
||||
if (typeof data === 'function') {
|
||||
dataFunction = data;
|
||||
data = {};
|
||||
} else if (typeof data !== 'object') {
|
||||
data = {};
|
||||
}
|
||||
|
||||
var globOptions = {
|
||||
stat: true,
|
||||
dot: true
|
||||
};
|
||||
|
||||
function onGlobEnd() {
|
||||
this._pending--;
|
||||
this._maybeFinalize();
|
||||
}
|
||||
|
||||
function onGlobError(err) {
|
||||
this.emit('error', err);
|
||||
}
|
||||
|
||||
function onGlobMatch(match){
|
||||
globber.pause();
|
||||
|
||||
var ignoreMatch = false;
|
||||
var entryData = Object.assign({}, data);
|
||||
entryData.name = match.relative;
|
||||
entryData.prefix = destpath;
|
||||
entryData.stats = match.stat;
|
||||
entryData.callback = globber.resume.bind(globber);
|
||||
|
||||
try {
|
||||
if (dataFunction) {
|
||||
entryData = dataFunction(entryData);
|
||||
|
||||
if (entryData === false) {
|
||||
ignoreMatch = true;
|
||||
} else if (typeof entryData !== 'object') {
|
||||
throw new ArchiverError('DIRECTORYFUNCTIONINVALIDDATA', { dirpath: dirpath });
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
this.emit('error', e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ignoreMatch) {
|
||||
globber.resume();
|
||||
return;
|
||||
}
|
||||
|
||||
this._append(match.absolute, entryData);
|
||||
}
|
||||
|
||||
var globber = glob(dirpath, globOptions);
|
||||
globber.on('error', onGlobError.bind(this));
|
||||
globber.on('match', onGlobMatch.bind(this));
|
||||
globber.on('end', onGlobEnd.bind(this));
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends a file given its filepath using a
|
||||
* [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to
|
||||
* prevent issues with open file limits.
|
||||
*
|
||||
* When the instance has received, processed, and emitted the file, the `entry`
|
||||
* event is fired.
|
||||
*
|
||||
* @param {String} filepath The source filepath.
|
||||
* @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and
|
||||
* [TarEntryData]{@link TarEntryData}.
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.file = function(filepath, data) {
|
||||
if (this._state.finalize || this._state.aborted) {
|
||||
this.emit('error', new ArchiverError('QUEUECLOSED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (typeof filepath !== 'string' || filepath.length === 0) {
|
||||
this.emit('error', new ArchiverError('FILEFILEPATHREQUIRED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
this._append(filepath, data);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends multiple files that match a glob pattern.
|
||||
*
|
||||
* @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/minimatch} to match.
|
||||
* @param {Object} options See [node-readdir-glob]{@link https://github.com/yqnn/node-readdir-glob#options}.
|
||||
* @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and
|
||||
* [TarEntryData]{@link TarEntryData}.
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.glob = function(pattern, options, data) {
|
||||
this._pending++;
|
||||
|
||||
options = util.defaults(options, {
|
||||
stat: true,
|
||||
pattern: pattern
|
||||
});
|
||||
|
||||
function onGlobEnd() {
|
||||
this._pending--;
|
||||
this._maybeFinalize();
|
||||
}
|
||||
|
||||
function onGlobError(err) {
|
||||
this.emit('error', err);
|
||||
}
|
||||
|
||||
function onGlobMatch(match){
|
||||
globber.pause();
|
||||
var entryData = Object.assign({}, data);
|
||||
entryData.callback = globber.resume.bind(globber);
|
||||
entryData.stats = match.stat;
|
||||
entryData.name = match.relative;
|
||||
|
||||
this._append(match.absolute, entryData);
|
||||
}
|
||||
|
||||
var globber = glob(options.cwd || '.', options);
|
||||
globber.on('error', onGlobError.bind(this));
|
||||
globber.on('match', onGlobMatch.bind(this));
|
||||
globber.on('end', onGlobEnd.bind(this));
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Finalizes the instance and prevents further appending to the archive
|
||||
* structure (queue will continue til drained).
|
||||
*
|
||||
* The `end`, `close` or `finish` events on the destination stream may fire
|
||||
* right after calling this method so you should set listeners beforehand to
|
||||
* properly detect stream completion.
|
||||
*
|
||||
* @return {Promise}
|
||||
*/
|
||||
Archiver.prototype.finalize = function() {
|
||||
if (this._state.aborted) {
|
||||
var abortedError = new ArchiverError('ABORTED');
|
||||
this.emit('error', abortedError);
|
||||
return Promise.reject(abortedError);
|
||||
}
|
||||
|
||||
if (this._state.finalize) {
|
||||
var finalizingError = new ArchiverError('FINALIZING');
|
||||
this.emit('error', finalizingError);
|
||||
return Promise.reject(finalizingError);
|
||||
}
|
||||
|
||||
this._state.finalize = true;
|
||||
|
||||
if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
|
||||
this._finalize();
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
var errored;
|
||||
|
||||
self._module.on('end', function() {
|
||||
if (!errored) {
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
|
||||
self._module.on('error', function(err) {
|
||||
errored = true;
|
||||
reject(err);
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the module format name used for archiving.
|
||||
*
|
||||
* @param {String} format The name of the format.
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.setFormat = function(format) {
|
||||
if (this._format) {
|
||||
this.emit('error', new ArchiverError('FORMATSET'));
|
||||
return this;
|
||||
}
|
||||
|
||||
this._format = format;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the module used for archiving.
|
||||
*
|
||||
* @param {Function} module The function for archiver to interact with.
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.setModule = function(module) {
|
||||
if (this._state.aborted) {
|
||||
this.emit('error', new ArchiverError('ABORTED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (this._state.module) {
|
||||
this.emit('error', new ArchiverError('MODULESET'));
|
||||
return this;
|
||||
}
|
||||
|
||||
this._module = module;
|
||||
this._modulePipe();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Appends a symlink to the instance.
|
||||
*
|
||||
* This does NOT interact with filesystem and is used for programmatically creating symlinks.
|
||||
*
|
||||
* @param {String} filepath The symlink path (within archive).
|
||||
* @param {String} target The target path (within archive).
|
||||
* @param {Number} mode Sets the entry permissions.
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.symlink = function(filepath, target, mode) {
|
||||
if (this._state.finalize || this._state.aborted) {
|
||||
this.emit('error', new ArchiverError('QUEUECLOSED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (typeof filepath !== 'string' || filepath.length === 0) {
|
||||
this.emit('error', new ArchiverError('SYMLINKFILEPATHREQUIRED'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (typeof target !== 'string' || target.length === 0) {
|
||||
this.emit('error', new ArchiverError('SYMLINKTARGETREQUIRED', { filepath: filepath }));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!this._moduleSupports('symlink')) {
|
||||
this.emit('error', new ArchiverError('SYMLINKNOTSUPPORTED', { filepath: filepath }));
|
||||
return this;
|
||||
}
|
||||
|
||||
var data = {};
|
||||
data.type = 'symlink';
|
||||
data.name = filepath.replace(/\\/g, '/');
|
||||
data.linkname = target.replace(/\\/g, '/');
|
||||
data.sourceType = 'buffer';
|
||||
|
||||
if (typeof mode === "number") {
|
||||
data.mode = mode;
|
||||
}
|
||||
|
||||
this._entriesCount++;
|
||||
this._queue.push({
|
||||
data: data,
|
||||
source: Buffer.concat([])
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the current length (in bytes) that has been emitted.
|
||||
*
|
||||
* @return {Number}
|
||||
*/
|
||||
Archiver.prototype.pointer = function() {
|
||||
return this._pointer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Middleware-like helper that has yet to be fully implemented.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} plugin
|
||||
* @return {this}
|
||||
*/
|
||||
Archiver.prototype.use = function(plugin) {
|
||||
this._streams.push(plugin);
|
||||
return this;
|
||||
};
|
||||
|
||||
module.exports = Archiver;
|
||||
|
||||
/**
|
||||
* @typedef {Object} CoreOptions
|
||||
* @global
|
||||
* @property {Number} [statConcurrency=4] Sets the number of workers used to
|
||||
* process the internal fs stat queue.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} TransformOptions
|
||||
* @property {Boolean} [allowHalfOpen=true] If set to false, then the stream
|
||||
* will automatically end the readable side when the writable side ends and vice
|
||||
* versa.
|
||||
* @property {Boolean} [readableObjectMode=false] Sets objectMode for readable
|
||||
* side of the stream. Has no effect if objectMode is true.
|
||||
* @property {Boolean} [writableObjectMode=false] Sets objectMode for writable
|
||||
* side of the stream. Has no effect if objectMode is true.
|
||||
* @property {Boolean} [decodeStrings=true] Whether or not to decode strings
|
||||
* into Buffers before passing them to _write(). `Writable`
|
||||
* @property {String} [encoding=NULL] If specified, then buffers will be decoded
|
||||
* to strings using the specified encoding. `Readable`
|
||||
* @property {Number} [highWaterMark=16kb] The maximum number of bytes to store
|
||||
* in the internal buffer before ceasing to read from the underlying resource.
|
||||
* `Readable` `Writable`
|
||||
* @property {Boolean} [objectMode=false] Whether this stream should behave as a
|
||||
* stream of objects. Meaning that stream.read(n) returns a single value instead
|
||||
* of a Buffer of size n. `Readable` `Writable`
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} EntryData
|
||||
* @property {String} name Sets the entry name including internal path.
|
||||
* @property {(String|Date)} [date=NOW()] Sets the entry date.
|
||||
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
|
||||
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
|
||||
* when working with methods like `directory` or `glob`.
|
||||
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
|
||||
* for reduction of fs stat calls when stat data is already known.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ErrorData
|
||||
* @property {String} message The message of the error.
|
||||
* @property {String} code The error code assigned to this error.
|
||||
* @property {String} data Additional data provided for reporting or debugging (where available).
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ProgressData
|
||||
* @property {Object} entries
|
||||
* @property {Number} entries.total Number of entries that have been appended.
|
||||
* @property {Number} entries.processed Number of entries that have been processed.
|
||||
* @property {Object} fs
|
||||
* @property {Number} fs.totalBytes Number of bytes that have been appended. Calculated asynchronously and might not be accurate: it growth while entries are added. (based on fs.Stats)
|
||||
* @property {Number} fs.processedBytes Number of bytes that have been processed. (based on fs.Stats)
|
||||
*/
|
||||
40
node_modules/archiver/lib/error.js
generated
vendored
Normal file
40
node_modules/archiver/lib/error.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Archiver Core
|
||||
*
|
||||
* @ignore
|
||||
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||
*/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
const ERROR_CODES = {
|
||||
'ABORTED': 'archive was aborted',
|
||||
'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value',
|
||||
'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function',
|
||||
'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value',
|
||||
'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value',
|
||||
'FINALIZING': 'archive already finalizing',
|
||||
'QUEUECLOSED': 'queue closed',
|
||||
'NOENDMETHOD': 'no suitable finalize/end method defined by module',
|
||||
'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module',
|
||||
'FORMATSET': 'archive format already set',
|
||||
'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance',
|
||||
'MODULESET': 'module already set',
|
||||
'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module',
|
||||
'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value',
|
||||
'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value',
|
||||
'ENTRYNOTSUPPORTED': 'entry not supported'
|
||||
};
|
||||
|
||||
function ArchiverError(code, data) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
//this.name = this.constructor.name;
|
||||
this.message = ERROR_CODES[code] || code;
|
||||
this.code = code;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
util.inherits(ArchiverError, Error);
|
||||
|
||||
exports = module.exports = ArchiverError;
|
||||
110
node_modules/archiver/lib/plugins/json.js
generated
vendored
Normal file
110
node_modules/archiver/lib/plugins/json.js
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* JSON Format Plugin
|
||||
*
|
||||
* @module plugins/json
|
||||
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||
*/
|
||||
var inherits = require('util').inherits;
|
||||
var Transform = require('readable-stream').Transform;
|
||||
|
||||
var crc32 = require('buffer-crc32');
|
||||
var util = require('archiver-utils');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {(JsonOptions|TransformOptions)} options
|
||||
*/
|
||||
var Json = function(options) {
|
||||
if (!(this instanceof Json)) {
|
||||
return new Json(options);
|
||||
}
|
||||
|
||||
options = this.options = util.defaults(options, {});
|
||||
|
||||
Transform.call(this, options);
|
||||
|
||||
this.supports = {
|
||||
directory: true,
|
||||
symlink: true
|
||||
};
|
||||
|
||||
this.files = [];
|
||||
};
|
||||
|
||||
inherits(Json, Transform);
|
||||
|
||||
/**
|
||||
* [_transform description]
|
||||
*
|
||||
* @private
|
||||
* @param {Buffer} chunk
|
||||
* @param {String} encoding
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
Json.prototype._transform = function(chunk, encoding, callback) {
|
||||
callback(null, chunk);
|
||||
};
|
||||
|
||||
/**
|
||||
* [_writeStringified description]
|
||||
*
|
||||
* @private
|
||||
* @return void
|
||||
*/
|
||||
Json.prototype._writeStringified = function() {
|
||||
var fileString = JSON.stringify(this.files);
|
||||
this.write(fileString);
|
||||
};
|
||||
|
||||
/**
|
||||
* [append description]
|
||||
*
|
||||
* @param {(Buffer|Stream)} source
|
||||
* @param {EntryData} data
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
Json.prototype.append = function(source, data, callback) {
|
||||
var self = this;
|
||||
|
||||
data.crc32 = 0;
|
||||
|
||||
function onend(err, sourceBuffer) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
|
||||
data.size = sourceBuffer.length || 0;
|
||||
data.crc32 = crc32.unsigned(sourceBuffer);
|
||||
|
||||
self.files.push(data);
|
||||
|
||||
callback(null, data);
|
||||
}
|
||||
|
||||
if (data.sourceType === 'buffer') {
|
||||
onend(null, source);
|
||||
} else if (data.sourceType === 'stream') {
|
||||
util.collectStream(source, onend);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* [finalize description]
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
Json.prototype.finalize = function() {
|
||||
this._writeStringified();
|
||||
this.end();
|
||||
};
|
||||
|
||||
module.exports = Json;
|
||||
|
||||
/**
|
||||
* @typedef {Object} JsonOptions
|
||||
* @global
|
||||
*/
|
||||
167
node_modules/archiver/lib/plugins/tar.js
generated
vendored
Normal file
167
node_modules/archiver/lib/plugins/tar.js
generated
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
/**
|
||||
* TAR Format Plugin
|
||||
*
|
||||
* @module plugins/tar
|
||||
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||
*/
|
||||
var zlib = require('zlib');
|
||||
|
||||
var engine = require('tar-stream');
|
||||
var util = require('archiver-utils');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {TarOptions} options
|
||||
*/
|
||||
var Tar = function(options) {
|
||||
if (!(this instanceof Tar)) {
|
||||
return new Tar(options);
|
||||
}
|
||||
|
||||
options = this.options = util.defaults(options, {
|
||||
gzip: false
|
||||
});
|
||||
|
||||
if (typeof options.gzipOptions !== 'object') {
|
||||
options.gzipOptions = {};
|
||||
}
|
||||
|
||||
this.supports = {
|
||||
directory: true,
|
||||
symlink: true
|
||||
};
|
||||
|
||||
this.engine = engine.pack(options);
|
||||
this.compressor = false;
|
||||
|
||||
if (options.gzip) {
|
||||
this.compressor = zlib.createGzip(options.gzipOptions);
|
||||
this.compressor.on('error', this._onCompressorError.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* [_onCompressorError description]
|
||||
*
|
||||
* @private
|
||||
* @param {Error} err
|
||||
* @return void
|
||||
*/
|
||||
Tar.prototype._onCompressorError = function(err) {
|
||||
this.engine.emit('error', err);
|
||||
};
|
||||
|
||||
/**
|
||||
* [append description]
|
||||
*
|
||||
* @param {(Buffer|Stream)} source
|
||||
* @param {TarEntryData} data
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
Tar.prototype.append = function(source, data, callback) {
|
||||
var self = this;
|
||||
|
||||
data.mtime = data.date;
|
||||
|
||||
function append(err, sourceBuffer) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
|
||||
self.engine.entry(data, sourceBuffer, function(err) {
|
||||
callback(err, data);
|
||||
});
|
||||
}
|
||||
|
||||
if (data.sourceType === 'buffer') {
|
||||
append(null, source);
|
||||
} else if (data.sourceType === 'stream' && data.stats) {
|
||||
data.size = data.stats.size;
|
||||
|
||||
var entry = self.engine.entry(data, function(err) {
|
||||
callback(err, data);
|
||||
});
|
||||
|
||||
source.pipe(entry);
|
||||
} else if (data.sourceType === 'stream') {
|
||||
util.collectStream(source, append);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* [finalize description]
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
Tar.prototype.finalize = function() {
|
||||
this.engine.finalize();
|
||||
};
|
||||
|
||||
/**
|
||||
* [on description]
|
||||
*
|
||||
* @return this.engine
|
||||
*/
|
||||
Tar.prototype.on = function() {
|
||||
return this.engine.on.apply(this.engine, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* [pipe description]
|
||||
*
|
||||
* @param {String} destination
|
||||
* @param {Object} options
|
||||
* @return this.engine
|
||||
*/
|
||||
Tar.prototype.pipe = function(destination, options) {
|
||||
if (this.compressor) {
|
||||
return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options);
|
||||
} else {
|
||||
return this.engine.pipe.apply(this.engine, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* [unpipe description]
|
||||
*
|
||||
* @return this.engine
|
||||
*/
|
||||
Tar.prototype.unpipe = function() {
|
||||
if (this.compressor) {
|
||||
return this.compressor.unpipe.apply(this.compressor, arguments);
|
||||
} else {
|
||||
return this.engine.unpipe.apply(this.engine, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Tar;
|
||||
|
||||
/**
|
||||
* @typedef {Object} TarOptions
|
||||
* @global
|
||||
* @property {Boolean} [gzip=false] Compress the tar archive using gzip.
|
||||
* @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
||||
* to control compression.
|
||||
* @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} TarEntryData
|
||||
* @global
|
||||
* @property {String} name Sets the entry name including internal path.
|
||||
* @property {(String|Date)} [date=NOW()] Sets the entry date.
|
||||
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
|
||||
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
|
||||
* when working with methods like `directory` or `glob`.
|
||||
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
|
||||
* for reduction of fs stat calls when stat data is already known.
|
||||
*/
|
||||
|
||||
/**
|
||||
* TarStream Module
|
||||
* @external TarStream
|
||||
* @see {@link https://github.com/mafintosh/tar-stream}
|
||||
*/
|
||||
120
node_modules/archiver/lib/plugins/zip.js
generated
vendored
Normal file
120
node_modules/archiver/lib/plugins/zip.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* ZIP Format Plugin
|
||||
*
|
||||
* @module plugins/zip
|
||||
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||
*/
|
||||
var engine = require('zip-stream');
|
||||
var util = require('archiver-utils');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {ZipOptions} [options]
|
||||
* @param {String} [options.comment] Sets the zip archive comment.
|
||||
* @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
|
||||
* @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
|
||||
* @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths.
|
||||
* @param {Boolean} [options.store=false] Sets the compression method to STORE.
|
||||
* @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
||||
*/
|
||||
var Zip = function(options) {
|
||||
if (!(this instanceof Zip)) {
|
||||
return new Zip(options);
|
||||
}
|
||||
|
||||
options = this.options = util.defaults(options, {
|
||||
comment: '',
|
||||
forceUTC: false,
|
||||
namePrependSlash: false,
|
||||
store: false
|
||||
});
|
||||
|
||||
this.supports = {
|
||||
directory: true,
|
||||
symlink: true
|
||||
};
|
||||
|
||||
this.engine = new engine(options);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {(Buffer|Stream)} source
|
||||
* @param {ZipEntryData} data
|
||||
* @param {String} data.name Sets the entry name including internal path.
|
||||
* @param {(String|Date)} [data.date=NOW()] Sets the entry date.
|
||||
* @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.
|
||||
* @param {String} [data.prefix] Sets a path prefix for the entry name. Useful
|
||||
* when working with methods like `directory` or `glob`.
|
||||
* @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing
|
||||
* for reduction of fs stat calls when stat data is already known.
|
||||
* @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE.
|
||||
* @param {Function} callback
|
||||
* @return void
|
||||
*/
|
||||
Zip.prototype.append = function(source, data, callback) {
|
||||
this.engine.entry(source, data, callback);
|
||||
};
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
Zip.prototype.finalize = function() {
|
||||
this.engine.finalize();
|
||||
};
|
||||
|
||||
/**
|
||||
* @return this.engine
|
||||
*/
|
||||
Zip.prototype.on = function() {
|
||||
return this.engine.on.apply(this.engine, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* @return this.engine
|
||||
*/
|
||||
Zip.prototype.pipe = function() {
|
||||
return this.engine.pipe.apply(this.engine, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* @return this.engine
|
||||
*/
|
||||
Zip.prototype.unpipe = function() {
|
||||
return this.engine.unpipe.apply(this.engine, arguments);
|
||||
};
|
||||
|
||||
module.exports = Zip;
|
||||
|
||||
/**
|
||||
* @typedef {Object} ZipOptions
|
||||
* @global
|
||||
* @property {String} [comment] Sets the zip archive comment.
|
||||
* @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
|
||||
* @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers.
|
||||
* @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths.
|
||||
* @property {Boolean} [store=false] Sets the compression method to STORE.
|
||||
* @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
||||
* to control compression.
|
||||
* @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ZipEntryData
|
||||
* @global
|
||||
* @property {String} name Sets the entry name including internal path.
|
||||
* @property {(String|Date)} [date=NOW()] Sets the entry date.
|
||||
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
|
||||
* @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths.
|
||||
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
|
||||
* when working with methods like `directory` or `glob`.
|
||||
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
|
||||
* for reduction of fs stat calls when stat data is already known.
|
||||
* @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* ZipStream Module
|
||||
* @external ZipStream
|
||||
* @see {@link https://www.archiverjs.com/zip-stream/ZipStream.html}
|
||||
*/
|
||||
60
node_modules/archiver/package.json
generated
vendored
Normal file
60
node_modules/archiver/package.json
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "archiver",
|
||||
"version": "5.3.1",
|
||||
"description": "a streaming interface for archive generation",
|
||||
"homepage": "https://github.com/archiverjs/node-archiver",
|
||||
"author": {
|
||||
"name": "Chris Talkington",
|
||||
"url": "http://christalkington.com/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/archiverjs/node-archiver.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/archiverjs/node-archiver/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --reporter dot",
|
||||
"bench": "node benchmark/simple/pack-zip.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"archiver-utils": "^2.1.0",
|
||||
"async": "^3.2.3",
|
||||
"buffer-crc32": "^0.2.1",
|
||||
"readable-stream": "^3.6.0",
|
||||
"readdir-glob": "^1.0.0",
|
||||
"tar-stream": "^2.2.0",
|
||||
"zip-stream": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"archiver-jsdoc-theme": "^1.1.3",
|
||||
"chai": "^4.2.0",
|
||||
"jsdoc": "^3.6.4",
|
||||
"mkdirp": "^1.0.4",
|
||||
"mocha": "^9.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"stream-bench": "^0.1.2",
|
||||
"tar": "^6.1.11",
|
||||
"yauzl": "^2.9.0"
|
||||
},
|
||||
"keywords": [
|
||||
"archive",
|
||||
"archiver",
|
||||
"stream",
|
||||
"zip",
|
||||
"tar"
|
||||
],
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user