How to use the jszip/dist/jszip.min.js.loadAsync function in jszip

To help you get started, we’ve selected a few jszip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github felipemanga / ProjectABE / src / components / Debugger.js View on Github external
fr.onload = evt => {
				
		JSZip.loadAsync( fr.result )
		    .then( z => this.importZipSourceFiles(z) );
		
	    };
	    fr.readAsArrayBuffer( file );
github felipemanga / ProjectABE / src / entities / Env.js View on Github external
loadArduboy( buff, cb ){
	let zip;
	let source = this.model.getModel( this.model.getItem("ram.srcpath"), true);
	
	JSZip.loadAsync( buff )
	    .then( z => (zip=z).file("info.json").async("text") )
	    .then( info => zip.file( JSON.parse( fixJSON(info) ).binaries[0].filename).async("text") )
	    .then( hex => {
		source.setItem(["build.hex"], hex);
		this.model.setItem("app.AT32u4.hex", hex);
		cb();
	    });

	function fixJSON( str ){
	    
	    if( str.charCodeAt(0) == 0xFEFF )
		str = str.substr(1);
	    
	    return str.replace(/\,(?!\s*?[\{\[\"\'\w])/g, '');
	    
	}
github felipemanga / ProjectABE / src / components / Debugger.js View on Github external
		.then( buff => JSZip.loadAsync( buff ) )
		.then( z => this.importZipSourceFiles(z) );

jszip

Create, read and edit .zip files with JavaScript http://stuartk.com/jszip

(MIT OR GPL-3.0-or-later)
Latest version published 2 years ago

Package Health Score

80 / 100
Full package analysis