mirror of
https://github.com/scratchfoundation/scratch-parser.git
synced 2025-08-28 22:18:45 -04:00
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:
parent
791bbab99b
commit
103db490a3
2 changed files with 9 additions and 6 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue