{
  "_args": [
    [
      "yauzl@https://registry.npmjs.org/yauzl/-/yauzl-2.3.1.tgz",
      "D:\\work\\3\\s"
    ]
  ],
  "_from": "yauzl@2.3.1",
  "_id": "yauzl@2.3.1",
  "_inCache": true,
  "_location": "/yauzl",
  "_phantomChildren": {},
  "_requested": {
    "name": "yauzl",
    "raw": "yauzl@https://registry.npmjs.org/yauzl/-/yauzl-2.3.1.tgz",
    "rawSpec": "https://registry.npmjs.org/yauzl/-/yauzl-2.3.1.tgz",
    "scope": null,
    "spec": "https://registry.npmjs.org/yauzl/-/yauzl-2.3.1.tgz",
    "type": "remote"
  },
  "_requiredBy": [
    "/",
    "/gulp-vinyl-zip"
  ],
  "_resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.3.1.tgz",
  "_shasum": "6707fe2b6a4dac9445cc429bf04a11c7dedfa36a",
  "_shrinkwrap": null,
  "_spec": "yauzl@https://registry.npmjs.org/yauzl/-/yauzl-2.3.1.tgz",
  "_where": "D:\\work\\3\\s",
  "author": {
    "email": "thejoshwolfe@gmail.com",
    "name": "Josh Wolfe"
  },
  "bugs": {
    "url": "https://github.com/thejoshwolfe/yauzl/issues"
  },
  "dependencies": {
    "fd-slicer": "~1.0.1",
    "pend": "~1.2.0"
  },
  "description": "yet another unzip library for node",
  "devDependencies": {
    "istanbul": "~0.3.4"
  },
  "homepage": "https://github.com/thejoshwolfe/yauzl",
  "keywords": [
    "unzip",
    "zip",
    "stream",
    "archive",
    "file"
  ],
  "license": "MIT",
  "main": "index.js",
  "name": "yauzl",
  "optionalDependencies": {},
  "readme": "# yauzl\n\n[![Build Status](https://travis-ci.org/thejoshwolfe/yauzl.svg?branch=master)](https://travis-ci.org/thejoshwolfe/yauzl)\n[![Coverage Status](https://img.shields.io/coveralls/thejoshwolfe/yauzl.svg)](https://coveralls.io/r/thejoshwolfe/yauzl)\n\nyet another unzip library for node. For zipping, see\n[yazl](https://github.com/thejoshwolfe/yazl).\n\nDesign principles:\n\n * Follow the spec.\n   Don't scan for local file headers.\n   Read the central directory for file metadata.\n   (see [No Streaming Unzip API](#no-streaming-unzip-api)).\n * Don't block the JavaScript thread.\n   Use and provide async APIs.\n * Keep memory usage under control.\n   Don't attempt to buffer entire files in RAM at once.\n * Never crash (if used properly).\n   Don't let malformed zip files bring down client applications who are trying to catch errors.\n * Catch unsafe filenames entries.\n   A zip file entry throws an error if its file name starts with `\"/\"` or `/[A-Za-z]:\\//`\n   or if it contains `\"..\"` path segments or `\"\\\\\"` (per the spec).\n\n## Usage\n\n```js\nvar yauzl = require(\"yauzl\");\nvar fs = require(\"fs\");\n\nyauzl.open(\"path/to/file.zip\", function(err, zipfile) {\n  if (err) throw err;\n  zipfile.on(\"entry\", function(entry) {\n    if (/\\/$/.test(entry.fileName)) {\n      // directory file names end with '/'\n      return;\n    }\n    zipfile.openReadStream(entry, function(err, readStream) {\n      if (err) throw err;\n      // ensure parent directory exists, and then:\n      readStream.pipe(fs.createWriteStream(entry.fileName));\n    });\n  });\n});\n```\n\n## API\n\nThe default for every `callback` parameter is:\n\n```js\nfunction defaultCallback(err) {\n  if (err) throw err;\n}\n```\n\n### open(path, [options], [callback])\n\nCalls `fs.open(path, \"r\")` and gives the `fd`, `options`, and `callback` to `fromFd()` below.\n\n`options` may be omitted or `null` and defaults to `{autoClose: true}`.\n\n### fromFd(fd, [options], [callback])\n\nReads from the fd, which is presumed to be an open .zip file.\nNote that random access is required by the zip file specification,\nso the fd cannot be an open socket or any other fd that does not support random access.\n\nThe `callback` is given the arguments `(err, zipfile)`.\nAn `err` is provided if the End of Central Directory Record Signature cannot be found in the file,\nwhich indicates that the fd is not a zip file.\n`zipfile` is an instance of `ZipFile`.\n\n`options` may be omitted or `null` and defaults to `{autoClose: false}`.\n`autoClose` is effectively equivalent to:\n\n```js\nzipfile.once(\"end\", function() {\n  zipfile.close();\n});\n```\n\n### fromBuffer(buffer, [callback])\n\nLike `fromFd()`, but reads from a RAM buffer instead of an open file.\n`buffer` is a `Buffer`.\n`callback` is effectively passed directly to `fromFd()`.\n\nIf a `ZipFile` is acquired from this method,\nit will never emit the `close` event,\nand calling `close()` is not necessary.\n\n### dosDateTimeToDate(date, time)\n\nConverts MS-DOS `date` and `time` data into a JavaScript `Date` object.\nEach parameter is a `Number` treated as an unsigned 16-bit integer.\nNote that this format does not support timezones,\nso the returned object will use the local timezone.\n\n### Class: ZipFile\n\nThe constructor for the class is not part of the public API.\nUse `open()`, `fromFd()`, or `fromBuffer()` instead.\n\n#### Event: \"entry\"\n\nCallback gets `(entry)`, which is an `Entry`.\n\n#### Event: \"end\"\n\nEmitted after the last `entry` event has been emitted.\n\n#### Event: \"close\"\n\nEmitted after the fd is actually closed.\nThis is after calling `close()` (or after the `end` event when `autoClose` is `true`),\nand after all streams created from `openReadStream()` have emitted their `end` events.\n\nThis event is never emitted if this `ZipFile` was acquired from `fromBuffer()`.\n\n#### Event: \"error\"\n\nEmitted in the case of errors with reading the zip file.\n(Note that other errors can be emitted from the streams created from `openReadStream()` as well.)\nAfter this event has been emitted, no further `entry`, `end`, or `error` events will be emitted,\nbut the `close` event may still be emitted.\n\n#### openReadStream(entry, [callback])\n\n`entry` must be an `Entry` object from this `ZipFile`.\n`callback` gets `(err, readStream)`, where `readStream` is a `Readable Stream`.\nIf the entry is compressed (with a supported compression method),\nthe read stream provides the decompressed data.\nIf this zipfile is already closed (see `close()`), the `callback` will receive an `err`.\n\nIt's possible for the `readStream` to emit errors for several reasons.\nFor example, if zlib cannot decompress the data, the zlib error will be emitted from the `readStream`.\nTwo more error cases are if the decompressed data has too many or too few actual bytes\ncompared to the reported byte count from the entry's `uncompressedSize` field.\nyauzl notices this false information and emits an error from the `readStream`\nafter some number of bytes have already been piped through the stream.\n\nBecause of this check, clients can always trust the `uncompressedSize` field in `Entry` objects.\nGuarding against [zip bomb](http://en.wikipedia.org/wiki/Zip_bomb) attacks can be accomplished by\ndoing some heuristic checks on the size metadata and then watching out for the above errors.\nSuch heuristics are outside the scope of this library,\nbut enforcing the `uncompressedSize` is implemented here as a security feature.\n\n#### close()\n\nCauses all future calls to `openReadStream()` to fail,\nand closes the fd after all streams created by `openReadStream()` have emitted their `end` events.\nIf this object's `end` event has not been emitted yet, this function causes undefined behavior.\n\nIf `autoClose` is `true` in the original `open()` or `fromFd()` call,\nthis function will be called automatically effectively in response to this object's `end` event.\n\n#### isOpen\n\n`Boolean`. `true` until `close()` is called; then it's `false`.\n\n#### entryCount\n\n`Number`. Total number of central directory records.\n\n#### comment\n\n`String`. Always decoded with `CP437` per the spec.\n\n### Class: Entry\n\nObjects of this class represent Central Directory Records.\nRefer to the zipfile specification for more details about these fields.\n\nThese fields are of type `Number`:\n\n * `versionMadeBy`\n * `versionNeededToExtract`\n * `generalPurposeBitFlag`\n * `compressionMethod`\n * `lastModFileTime` (MS-DOS format, see `getLastModDateTime`)\n * `lastModFileDate` (MS-DOS format, see `getLastModDateTime`)\n * `crc32`\n * `compressedSize`\n * `uncompressedSize`\n * `fileNameLength` (bytes)\n * `extraFieldLength` (bytes)\n * `fileCommentLength` (bytes)\n * `internalFileAttributes`\n * `externalFileAttributes`\n * `relativeOffsetOfLocalHeader`\n\n#### fileName\n\n`String`.\nFollowing the spec, the bytes for the file name are decoded with\n`UTF-8` if `generalPurposeBitFlag & 0x800`, otherwise with `CP437`.\n\nIf `fileName` would contain unsafe characters, such as an absolute path or\na relative directory, yauzl emits an error instead of an entry.\n\n#### extraFields\n\n`Array` with each entry in the form `{id: id, data: data}`,\nwhere `id` is a `Number` and `data` is a `Buffer`.\nNone of the extra fields are considered significant by this library.\n\n#### comment\n\n`String` decoded with the same charset as used for `fileName`.\n\n#### getLastModDate()\n\nEffectively implemented as:\n\n```js\nreturn dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);\n```\n\n## How to Avoid Crashing\n\nWhen a malformed zipfile is encountered, the default behavior is to crash (throw an exception).\nIf you want to handle errors more gracefully than this,\nbe sure to do the following:\n\n * Provide `callback` parameters where they are allowed, and check the `err` parameter.\n * Attach a listener for the `error` event on any `ZipFile` object you get from `open()`, `fromFd()`, or `fromBuffer()`.\n * Attach a listener for the `error` event on any stream you get from `openReadStream()`.\n\n## Limitations\n\n### No Streaming Unzip API\n\nDue to the design of the .zip file format, it's impossible to interpret a .zip file from start to finish\n(such as from a readable stream) without sacrificing correctness.\nThe Central Directory, which is the authority on the contents of the .zip file, is at the end of a .zip file, not the beginning.\nA streaming API would need to either buffer the entire .zip file to get to the Central Directory before interpreting anything\n(defeating the purpose of a streaming interface), or rely on the Local File Headers which are interspersed through the .zip file.\nHowever, the Local File Headers are explicitly denounced in the spec as being unreliable copies of the Central Directory,\nso trusting them would be a violation of the spec.\n\nAny library that offers a streaming unzip API must make one of the above two compromises,\nwhich makes the library either dishonest or nonconformant (usually the latter).\nThis library insists on correctness and adherence to the spec, and so does not offer a streaming API.\n\n### No Multi-Disk Archive Support\n\nThis library does not support multi-disk zip files.\nThe multi-disk fields in the zipfile spec were intended for a zip file to span multiple floppy disks,\nwhich probably never happens now.\nIf the \"number of this disk\" field in the End of Central Directory Record is not `0`,\nthe `open()`, `fromFd()`, or `fromBuffer()` `callback` will receive an `err`.\nBy extension the following zip file fields are ignored by this library and not provided to clients:\n\n * Disk where central directory starts\n * Number of central directory records on this disk\n * Disk number where file starts\n\n### No Encryption Support\n\nCurrently, the presence of encryption is not even checked,\nand encrypted zip files will cause undefined behavior.\n\n### Local File Headers Are Ignored\n\nMany unzip libraries mistakenly read the Local File Header data in zip files.\nThis data is officially defined to be redundant with the Central Directory information,\nand is not to be trusted.\nAside from checking the signature, yauzl ignores the content of the Local File Header.\n\n### No CRC-32 Checking\n\nThis library provides the `crc32` field of `Entry` objects read from the Central Directory.\nHowever, this field is not used for anything in this library.\n\n### versionNeededToExtract Is Ignored\n\nThe field `versionNeededToExtract` is ignored,\nbecause this library doesn't support the complete zip file spec at any version,\n\n### No Support For Obscure Compression Methods\n\nRegarding the `compressionMethod` field of `Entry` objects,\nonly method `0` (stored with no compression)\nand method `8` (deflated) are supported.\nAny of the other 15 official methods will cause the `openReadStream()` `callback` to receive an `err`.\n\n### No ZIP64 Support\n\nA ZIP64 file will probably cause undefined behavior.\n\n### Data Descriptors Are Ignored\n\nThere may or may not be Data Descriptor sections in a zip file.\nThis library provides no support for finding or interpreting them.\n\n### Archive Extra Data Record Is Ignored\n\nThere may or may not be an Archive Extra Data Record section in a zip file.\nThis library provides no support for finding or interpreting it.\n\n### No Language Encoding Flag Support\n\nZip files officially support charset encodings other than CP437 and UTF-8,\nbut the zip file spec does not specify how it works.\nThis library makes no attempt to interpret the Language Encoding Flag.\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/thejoshwolfe/yauzl.git"
  },
  "scripts": {
    "test": "node test/test.js",
    "test-cov": "istanbul cover test/test.js",
    "test-travis": "istanbul cover --report lcovonly test/test.js"
  },
  "version": "2.3.1"
}
