decompress
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -28,2 +28,3 @@ 'use strict'; | ||
opts = opts || {}; | ||
opts.path = opts.path || process.cwd(); | ||
var extractor = this._getExtractor(opts.type); | ||
@@ -30,0 +31,0 @@ |
{ | ||
"name": "decompress", | ||
"version": "0.1.0", | ||
"description": "Extract archives", | ||
"version": "0.1.1", | ||
"description": "Easily extract zip, tar and tar.gz archives", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "extract", |
# decompress [![Build Status](https://secure.travis-ci.org/kevva/decompress.png?branch=master)](http://travis-ci.org/kevva/decompress) | ||
Easily extract `.zip`, `.tar` and `.tar.gz` archives. Based on the extract | ||
utility in Bower. | ||
utility in [Bower](https://github.com/bower/bower). | ||
@@ -12,2 +12,5 @@ ## Getting started | ||
You'll only need to give decompress a `type` and it'll figure the rest out for | ||
you. | ||
```js | ||
@@ -25,7 +28,9 @@ var decompress = require('decompress'); | ||
Extract an archive using the `type` option to determine which extractor to use. | ||
Extract an archive using the `type` option to determine which extractor to use. | ||
If no `path` is specified it'll extract it to your current location. | ||
### decompress.canExtract(file) | ||
### decompress.canExtract(src, mime) | ||
Determine if the file can be extracted or not. | ||
Determine if a file can be extracted or not by checking the file extension | ||
and/or the MIME type. | ||
@@ -35,6 +40,18 @@ ```js | ||
// => true | ||
decompress.canExtract('application/zip'); | ||
// => true | ||
``` | ||
## Options | ||
* `type` — String that can be a file name, URL or a MIME type for example. | ||
* `path` — Path to extract the archive to. If no `path` is specified it'll | ||
extract it to your current location. | ||
You can also define options accepted by the different extractors. See [unzip](https://github.com/nearinfinity/node-unzip/) and [tar](https://github.com/isaacs/node-tar/) | ||
for more information. | ||
## License | ||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4555
65
55