Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm module? #5

Open
btzr-io opened this issue Sep 21, 2016 · 8 comments
Open

npm module? #5

btzr-io opened this issue Sep 21, 2016 · 8 comments

Comments

@btzr-io
Copy link

btzr-io commented Sep 21, 2016

No description provided.

@workhorsy
Copy link
Owner

I originally made this module to work in the browser. I have never tested it with Node. I assume it will work with minimal modifications, but I have no experience making NPM modules.

I would love if someone could help out in making a NPM module happen. Any help with that would be greatly appreciated.

@btzr-io
Copy link
Author

btzr-io commented Sep 22, 2016

Load libunrar.js in a web-worker and call readRARContent function, read the source code for parameter/return value. Also read worker.js, index.html for usage example.

It seems like libunrar.js wont work because node js doesn't support web worker, but maybe I'm wrong:

Node integration doesn't work in web workers, and there is no plan to do. Workers in Chromium are implemented by starting a new thread, and Node is not thread safe. Back in past we had tried to add node integration to web workers in Atom, but it crashed too easily so we gave up on it.

@btzr-io
Copy link
Author

btzr-io commented Sep 22, 2016

If you are in node.js environment then this is probably useless for you because you can call the native unrar utility/library
https://github.com/wcchoi/libunrar-js#why

@btzr-io
Copy link
Author

btzr-io commented Sep 22, 2016

Minimal modifications:

@btzr-io
Copy link
Author

btzr-io commented Sep 22, 2016

Something like this package.json
libunrar.js alternative: unrar utility/library (not sure if is the best alternative)

@workhorsy
Copy link
Owner

The libunrar.js we use is just the official Rarlabs unrar compiled to JS using Emscripten. So it works the same, but uses much more RAM and CPU. So if you are on a system with unrar installed, that would be a much better thing to use.

@workhorsy
Copy link
Owner

Also note. Our version of libunrar.js has been modified to work without a WebWorker. The original version at https://github.com/wcchoi/libunrar-js uses a WebWorker. So that should not be a problem.

@btzr-io
Copy link
Author

btzr-io commented Sep 22, 2016

Ok, I just found this: unarchiver, supported file formats include Zip, Tar-GZip, Tar-BZip2, RAR and more,
also there is a npm package: https://www.npmjs.com/package/unpack-all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants