Skip to content

Commit f6c9cc2

Browse files
authoredMar 7, 2021
Update zip.js
1 parent fb8e46a commit f6c9cc2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎lib/plugins/zip.js

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var util = require('archiver-utils');
1414
* @param {String} [options.comment] Sets the zip archive comment.
1515
* @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
1616
* @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
17+
* @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths.
1718
* @param {Boolean} [options.store=false] Sets the compression method to STORE.
1819
* @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
1920
*/
@@ -25,6 +26,7 @@ var Zip = function(options) {
2526
options = this.options = util.defaults(options, {
2627
comment: '',
2728
forceUTC: false,
29+
namePrependSlash: false,
2830
store: false
2931
});
3032

@@ -90,6 +92,7 @@ module.exports = Zip;
9092
* @property {String} [comment] Sets the zip archive comment.
9193
* @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
9294
* @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers.
95+
* @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths.
9396
* @property {Boolean} [store=false] Sets the compression method to STORE.
9497
* @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
9598
* to control compression.
@@ -102,6 +105,7 @@ module.exports = Zip;
102105
* @property {String} name Sets the entry name including internal path.
103106
* @property {(String|Date)} [date=NOW()] Sets the entry date.
104107
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
108+
* @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths.
105109
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
106110
* when working with methods like `directory` or `glob`.
107111
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing

0 commit comments

Comments
 (0)
Please sign in to comment.