123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- var engine = require('zip-stream');
- var util = require('archiver-utils');
- var Zip = function(options) {
- if (!(this instanceof Zip)) {
- return new Zip(options);
- }
- options = this.options = util.defaults(options, {
- comment: '',
- forceUTC: false,
- store: false
- });
- this.supports = {
- directory: true,
- symlink: true
- };
- this.engine = new engine(options);
- };
- Zip.prototype.append = function(source, data, callback) {
- this.engine.entry(source, data, callback);
- };
- Zip.prototype.finalize = function() {
- this.engine.finalize();
- };
- Zip.prototype.on = function() {
- return this.engine.on.apply(this.engine, arguments);
- };
- Zip.prototype.pipe = function() {
- return this.engine.pipe.apply(this.engine, arguments);
- };
- Zip.prototype.unpipe = function() {
- return this.engine.unpipe.apply(this.engine, arguments);
- };
- module.exports = Zip;
|