diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-03-06 11:06:43 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-03-06 11:06:43 +0000 |
| commit | f5b9b1c8632de9f2066bc45ded336d1e04e64aab (patch) | |
| tree | c2351d3052b1bb3fc0f0d470be1786100303113e /lib/unzip.js | |
| parent | 85e30f452001b5d02a617da21c72e12b206dfdb4 (diff) | |
Use bluebird instead of q for better performance
Diffstat (limited to 'lib/unzip.js')
| -rw-r--r-- | lib/unzip.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/unzip.js b/lib/unzip.js index cad8c2d..855d2ca 100644 --- a/lib/unzip.js +++ b/lib/unzip.js @@ -1,6 +1,6 @@ exports.openZip = openZip; -var q = require("q"); +var promises = require("./promises"); var fs = require("fs"); var unzip = { Parse: require("unzip/lib/parse") @@ -14,12 +14,12 @@ function openZip(options) { } else if (options.file) { return options.file; } else { - return q.reject(new Error("Could not find file in options")); + return promises.reject(new Error("Could not find file in options")); } } function unzipStream(stream) { - var deferred = q.defer(); + var deferred = promises.defer(); var names = []; var files = {}; @@ -41,7 +41,7 @@ function unzipStream(stream) { } function readEntry(entry) { - var readDeferred = q.defer(); + var readDeferred = promises.defer(); var buffers = new Buffers(); entry @@ -58,7 +58,7 @@ function unzipStream(stream) { var zipFile = { read: function(path, encoding) { if (!exists(path)) { - return q.reject(new Error("No file in zip: " + path)); + return promises.reject(new Error("No file in zip: " + path)); } return files[path].then(function(buffer) { if (encoding) { |
