build(unpack): Swap out 3rd party zip library

Swapping out adm-zip dependency with jszip for use with the browser.
This commit is contained in:
Karishma Chadha 2018-02-25 21:19:51 -05:00
parent 791bbab99b
commit 103db490a3
2 changed files with 9 additions and 6 deletions

View file

@ -1,4 +1,4 @@
var Adm = require('adm-zip');
var JSZip = require('jszip');
/**
* Transforms buffer into a UTF-8 string. If input is encoded in ZIP format,
@ -33,7 +33,10 @@ module.exports = function (input, callback) {
// Handle zip
// @todo Handle error
var zip = new Adm(input);
var project = zip.readAsText('project.json', 'utf8');
callback(null, project);
JSZip.loadAsync(input).then(function (zip) {
zip.file('project.json').async('string')
.then(function (project) {
callback(null, project);
});
});
};