GithubHelp home page GithubHelp logo

workhorsy / uncompress.js Goto Github PK

View Code? Open in Web Editor NEW
104.0 104.0 17.0 676 KB

Uncompress ZIP, RAR, and TAR files with pure JavaScript

Home Page: http://workhorsy.github.io/uncompress.js/examples

License: MIT License

JavaScript 100.00%
javascript rar tar unrar untar unzip zip

uncompress.js's People

Contributors

workhorsy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

uncompress.js's Issues

Change loadArchiveFormats to use a callback

Change loadArchiveFormats to use a callback, to prevent users from calling functions, before the library is ready.

// Change this
loadArchiveFormats(['rar', 'zip', 'tar']);

archiveOpenFile(file, function(archive, err) {
    // read archive here
});
// To this
loadArchiveFormats(['rar', 'zip', 'tar'], function() {
    archiveOpenFile(file, function(archive, err) {
        // read archive here
    });
});

Docs?

Sorry if I'm missing the obvious - but are there any docs?

Rar file not being recognized

I'm building a drag/drop reader for CBR/CBZ files. I'm using this code to dynamically switch between working w/ a rar or zip based on the extension (and yeah, the check is a bit lame):

function handleFile(file) {
	console.log('try to parse '+file.name);
	let fileReader = new FileReader();
	let ext = ".zip";
	if(file.name.indexOf(".cbr") >= 0) {
		//above should check END of name, not anywhere
		ext = ".rar";
	}
	console.log('This is a '+ext);
	fileReader.onload = function() {
		console.log('onload');
		let array_buffer = this.result;
		console.log(array_buffer);
		let archive = archiveOpenArrayBuffer("example_rar_5"+ext, null, array_buffer);
		if (archive) {
			console.info('Uncompressing ' + archive.archive_type + ' ...');
			console.dir(archive);
			//onArchiveLoaded(archive);
		} else {
			//console.error(err);
		}
	}
	fileReader.readAsArrayBuffer(file);

I can confirm that dropping a cbz file works fine, but dropping a cbr gives me: Error: The archive type is unknown.

Any idea why?

Desscompresion progress

I'm not sure if this is possible or useful,
but would be nice to keep track of the decompression progress.

There is some problem in uncompress.js

The function currentScriptPath() is so skillfully method to get path. But i can't get the correct path on my device. I find why it not work correctly.

the problem in uncompress.js line 39 : "
line = stack.split('(')[1].split(')')[0];
"

because my project path include parenthesis mark, so that function can not cacth the correct path.

and I fix this bug with use RegEx like this : "
line = stack.split(/[\s][(]/)[1].split(/[)][\n]/)[0];
โ€œ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.