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

Can you give a one that can be run on a mobile browser (wasm)? #3

Closed
freekoy opened this issue Apr 22, 2019 · 4 comments
Closed

Can you give a one that can be run on a mobile browser (wasm)? #3

freekoy opened this issue Apr 22, 2019 · 4 comments

Comments

@freekoy
Copy link

freekoy commented Apr 22, 2019

rt

@YuJianrong
Copy link
Owner

I think it's working on Mobile Browser. What's the reason of your request on wasm? Performance?

@freekoy freekoy closed this as completed May 25, 2019
@klesun
Copy link

klesun commented Dec 25, 2020

Wow, cool, does it work in browser even though it's called node-unrar.js? I'd file a PR to add that info in README then, it would open so many use cases for this lib...

webpack build only seems to require this addition to the webpack config to pass:

module.exports = {
  ...
  node: {
    fs: "empty"
  }
}
  • Upd.: getting TypeError: unrar.RarArchive is not a constructor when I try to run compiled bundle in the browser ;c
    It seems to come from Emscripten, maybe that's what was meant by "wasm"...
  • Upd.2: tried to build with npm run browserify - same error
  • Upd.3: I managed to solve RarArchive issue by adding a -s MODULARIZE=1 flag to emscripten in make.ts and changing all imports from
    import * as unrar from './unrar';
    to
    import * as unrarCls from './unrar';
    const unrar = new (<any>unrarCls);

klesun added a commit to klesun-misc/node-unrar.js-issue3 that referenced this issue Dec 26, 2020
@klesun
Copy link

klesun commented Dec 26, 2020

@YuJianrong would you consider reviewing/accepting #8? It makes npm run browserify produce a working build for browser.

@YuJianrong
Copy link
Owner

Browser is supported in the latest release v1.0.0
Note: Only the api to load/extract from memory is supported in browser.

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

No branches or pull requests

3 participants