mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
13 lines
312 B
JavaScript
13 lines
312 B
JavaScript
|
const AdmZip = require('adm-zip');
|
||
|
const fs = require('fs');
|
||
|
|
||
|
module.exports = {
|
||
|
readAsBuffer: function (path) {
|
||
|
return new Buffer(fs.readFileSync(path));
|
||
|
},
|
||
|
readAsString: function (path) {
|
||
|
const zip = new AdmZip(path);
|
||
|
return zip.readAsText('project.json', 'utf8');
|
||
|
}
|
||
|
};
|