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

Have a pure browser version of seek-bzip #2

Open
mossroy opened this issue Nov 24, 2013 · 2 comments
Open

Have a pure browser version of seek-bzip #2

mossroy opened this issue Nov 24, 2013 · 2 comments

Comments

@mossroy
Copy link

mossroy commented Nov 24, 2013

This is not an issue, but only a wish.

I would really like to use seek-bzip in my web application. I currently use antimatter15's bzip2.js : it works pretty well, but I think seek-bzip might improve the performance of my webapp. Because seek-bzip would allow me to decompress only what's necessary (by passing the expectedSize parameter)
(see kiwix/kiwix-js#4 )

I tried by myself to remove the node.js dependencies but did not manage to do it.

Would there be an easy way to use seek-bzip in a browser instead of a node.js environment?

@cscott
Copy link
Owner

cscott commented Nov 24, 2013

Have you tried browserify?
On Nov 24, 2013 3:21 PM, "mossroy" notifications@github.com wrote:

This is not an issue, but only a wish.

I would really like to use seek-bzip in my web application. I currently
use antimatter15's bzip2.js : it works pretty well, but I think seek-bzip
might improve the performance of my webapp. Because seek-bzip would allow
me to decompress only what's necessary (by passing the expectedSize
parameter)
(see kiwix/kiwix-js#4kiwix/kiwix-js#4)

I tried by myself to remove the node.js dependencies but did not manage to
do it.

Would there be an easy way to use seek-bzip in a browser instead of a
node.js environment?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2
.

@mossroy
Copy link
Author

mossroy commented Nov 25, 2013

Thanks for the suggestion. I just tried to browserify seek-bzip.
It gave me this : http://pastebin.mozilla.org/3669387

But I did not manage to make it work.
First, I'm currently using requirejs in my application, and I think it might introduce conflicts with the "require" function. In any case, I did not manage to load seek-bzip as a requirejs module
Never mind, I tried to use it directly in a simple HTML page (without any requirejs environment), but did not manage to.
In fact, I don't find the way to access Bunzip class after importing the javascript.

In the examples from http://browserify.org or https://github.com/substack/node-browserify, they execute code directly from inside the node.js modules. What I would need is to access this code from other javascript files, in order to call Bunzip.decode(something)

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

2 participants