mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-26 16:02:54 -05:00
12 lines
334 B
JavaScript
12 lines
334 B
JavaScript
const AdmZip = require('adm-zip');
|
|
const fs = require('fs');
|
|
|
|
module.exports = {
|
|
readFileToBuffer: function (path) {
|
|
return new Buffer(fs.readFileSync(path));
|
|
},
|
|
extractProjectJson: function (path) {
|
|
const zip = new AdmZip(path);
|
|
return JSON.parse(zip.readAsText('project.json', 'utf8'));
|
|
}
|
|
};
|