src/virtual-machine.js
/**
     * Load a project from a Scratch 3.0 sb3 file containing a project json
     * and all of the sound and costume files.
     * @param {Buffer} inputBuffer A buffer representing the project to load.
     * @return {!Promise} Promise that resolves after targets are installed.
     */
Load a project from a Scratch 3.0 sb3 file containing a project json
and all of the sound and costume files.
@param {Buffer} inputBuffer A buffer representing the project to load.
@return {!Promise} Promise that resolves after targets are installed.
Load a project from a Scratch 3 . 0 sb3 file containing a project json and all of the sound and costume files . @param { Buffer } inputBuffer A buffer representing the project to load . @return { !Promise } Promise that resolves after targets are installed .
loadProjectLocal (inputBuffer) {
        return JSZip.loadAsync(inputBuffer)
            .then(sb3File => {
                sb3File.file('project.json').async('string')
                    .then(json => {
                        json = JSON.parse(json); 
                        return sb3.deserialize(json, this.runtime, sb3File)
                            .then(({targets, extensions}) =>
                                this.installTargets(targets, extensions, true));
                    });
            });
    }
loadProjectLocal ( inputBuffer ) { return JSZip . loadAsync ( inputBuffer ) . then ( sb3File => { sb3File . file ( 'project.json' ) . async ( 'string' ) . then ( json => { json = JSON . parse ( json ) ; return sb3 . deserialize ( json , this . runtime , sb3File ) . then ( ( { targets , extensions } ) => this . installTargets ( targets , extensions , true ) ) ; } ) ; } ) ; }
Load a project from a Scratch 3.0 sb3 file containing a project json
 and all of the sound and costume files.
Load a project from a Scratch 3 . 0 sb3 file containing a project json and all of the sound and costume files .
// TODO need to handle sb2 files as well, and will possibly merge w/ // above function // TODO error handling for unpacking zip/not finding project.json // TODO catch errors here (validation)