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

Browser not a supported target? #8

Open
vlovich opened this issue Jan 31, 2022 · 3 comments
Open

Browser not a supported target? #8

vlovich opened this issue Jan 31, 2022 · 3 comments

Comments

@vlovich
Copy link

vlovich commented Jan 31, 2022

Is the browser environment not a supported target? Buffer is a NodeJS only concept. In browser land, the Buffer.from in most spots would be new TextEncoder. Base64 decode of binary data would be handled by something like base64-js. Maybe detect-node could be to conditionally import the dependencies appropriately and to select which Base64 decoding to use?

@papandreou
Copy link
Collaborator

We haven't made much of an effort to support the browser environment. However, the module has been known to work in eg. webpack builds (#5) where these things are polyfilled.

@vlovich
Copy link
Author

vlovich commented Feb 1, 2022

Any appetite for a patch that fixes it so that no polyfills are required?

@papandreou
Copy link
Collaborator

papandreou commented Feb 1, 2022

That depends on the patch (😼), but I'd be happy to take a look.

@vlovich vlovich mentioned this issue Feb 1, 2022
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