lib/zip.js
function File(zip, filename, modified) {
  this.zip = zip;
  this.filename = filename;
  this.modified = modified || new Date();
  // True while file is writeable (end/destroy change this)
  this.writable = true;
  // We use this to hold any buffer if this is not the active file
  this._buffers = [];
  // Make sure we only write header once.
  this._wroteHeader = false;
  // True if file fully written out; distinct from fully read (writable = false)
  this._done = false;
  // Offset of file within the stream
  this._offset = 0;
  this._crc = 0 ^ -1;
  this._compressedLength = this._uncompressedLength = 0;

  // Write to _deflate, count data size before passing to output.
  var file = this;
  this._deflate = Zlib.createDeflateRaw();
  this._deflate.on("data", function(buffer) {
    file._compressedLength += buffer.length;
    zip._writeBuffer(buffer);
  });
  this._deflate.on("end", function(buffer) {
    file._doneWritingFile();
  });
}
function File(zip, filename, modified) {
  this.zip = zip;
  this.filename = filename;
  this.modified = modified || new Date();
  // True while file is writeable (end/destroy change this)
  this.writable = true;
  // We use this to hold any buffer if this is not the active file
  this._buffers = [];
  // Make sure we only write header once.
  this._wroteHeader = false;
  // True if file fully written out; distinct from fully read (writable = false)
  this._done = false;
  // Offset of file within the stream
  this._offset = 0;
  this._crc = 0 ^ -1;
  this._compressedLength = this._uncompressedLength = 0;

  // Write to _deflate, count data size before passing to output.
  var file = this;
  this._deflate = Zlib.createDeflateRaw();
  this._deflate.on("data", function(buffer) {
    file._compressedLength += buffer.length;
    zip._writeBuffer(buffer);
  });
  this._deflate.on("end", function(buffer) {
    file._doneWritingFile();
  });
}
function File ( zip , filename , modified ) { this . zip = zip ; this . filename = filename ; this . modified = modified || new Date ( ) ; // True while file is writeable (end/destroy change this) this . writable = true ; // We use this to hold any buffer if this is not the active file this . _buffers = [ ] ; // Make sure we only write header once. this . _wroteHeader = false ; // True if file fully written out; distinct from fully read (writable = false) this . _done = false ; // Offset of file within the stream this . _offset = 0 ; this . _crc = 0 ^ - 1 ; this . _compressedLength = this . _uncompressedLength = 0 ; // Write to _deflate, count data size before passing to output. var file = this ; this . _deflate = Zlib . createDeflateRaw ( ) ; this . _deflate . on ( "data" , function ( buffer ) { file . _compressedLength += buffer . length ; zip . _writeBuffer ( buffer ) ; } ) ; this . _deflate . on ( "end" , function ( buffer ) { file . _doneWritingFile ( ) ; } ) ; }
Creates a new Zip file.  zip      - Zip object filename - Filename modified - Modified date (optional)
Creates a new Zip file . zip - Zip object filename - Filename modified - Modified date ( optional )