{ "name": "decompress-zip", "version": "0.1.0", "description": "Extract files from a ZIP archive", "main": "lib/decompress-zip.js", "scripts": { "test": "grunt test" }, "bin": { "decompress-zip": "bin/decompress-zip" }, "repository": { "type": "git", "url": "git+https://github.com/bower/decompress-zip.git" }, "engines": { "node": ">=0.10.0" }, "keywords": [ "zip", "unzip", "tar", "untar", "compress", "decompress", "archive", "extract", "zlib" ], "author": { "name": "Bower team" }, "licenses": [ { "type": "MIT", "url": "https://github.com/bower/bower/blob/master/LICENSE" } ], "dependencies": { "binary": "^0.3.0", "graceful-fs": "^3.0.0", "mkpath": "^0.1.0", "nopt": "^3.0.1", "q": "^1.1.2", "readable-stream": "^1.1.8", "touch": "0.0.3" }, "devDependencies": { "chai": "^1.10.0", "glob": "^4.3.2", "grunt": "^0.4.1", "grunt-cli": "^0.1.13", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-watch": "^0.6.1", "grunt-exec": "^0.4.2", "grunt-simple-mocha": "^0.4.0", "istanbul": "^0.3.5", "mocha": "^2.1.0", "request": "^2.51.0", "tmp": "0.0.24" }, "readme": "# decompress-zip [![Build Status](https://travis-ci.org/bower/decompress-zip.svg?branch=master)](https://travis-ci.org/bower/decompress-zip)\n\n> Extract files from a ZIP archive\n\n\n## Usage\n\n### .extract(options)\n\nExtracts the contents of the ZIP archive `file`.\n\nReturns an EventEmitter with two possible events - `error` on an error, and `extract` when the extraction has completed. The value passed to the `extract` event is a basic log of each file and how it was compressed.\n\n**Options**\n- **path** *String* - Path to extract into (default `.`)\n- **follow** *Boolean* - If true, rather than create stored symlinks as symlinks make a shallow copy of the target instead (default `false`)\n- **filter** *Function* - A function that will be called once for each file in the archive. It takes one argument which is an object containing details of the file. Return true for any file that you want to extract, and false otherwise. (default `null`)\n- **strip** *Number* - Remove leading folders in the path structure. Equivalent to `--strip-components` for tar.\n\n```js\nvar DecompressZip = require('decompress-zip');\nvar unzipper = new DecompressZip(filename)\n\nunzipper.on('error', function (err) {\n console.log('Caught an error');\n});\n\nunzipper.on('extract', function (log) {\n console.log('Finished extracting');\n});\n\nunzipper.on('progress', function (fileIndex, fileCount) {\n console.log('Extracted file ' + (fileIndex + 1) + ' of ' + fileCount);\n});\n\nunzipper.extract({\n path: 'some/path',\n filter: function (file) {\n return file.type !== \"SymbolicLink\";\n }\n});\n```\n\nIf `path` does not exist, decompress-zip will attempt to create it first.\n\n### .list()\n\nMuch like extract, except:\n- the success event is `list`\n- the data for the event is an array of paths\n- no files are actually extracted\n- there are no options\n\n```js\nvar DecompressZip = require('decompress-zip');\nvar unzipper = new DecompressZip(filename)\n\nunzipper.on('error', function (err) {\n console.log('Caught an error');\n});\n\nunzipper.on('list', function (files) {\n console.log('The archive contains:');\n console.log(files);\n});\n\nunzipper.list();\n```\n\n\n## License\n\nMIT © Bower team\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/bower/decompress-zip/issues" }, "homepage": "https://github.com/bower/decompress-zip#readme", "_id": "decompress-zip@0.1.0", "_shasum": "bce60c11664f2d660fca4bcf634af6de5d6c14c7", "_resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.1.0.tgz", "_from": "decompress-zip@>=0.1.0 <0.2.0" }