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

Why was the Buffer dependency added? #130

Closed
balloob opened this issue Feb 18, 2024 · 1 comment · Fixed by #132
Closed

Why was the Buffer dependency added? #130

balloob opened this issue Feb 18, 2024 · 1 comment · Fixed by #132

Comments

@balloob
Copy link
Contributor

balloob commented Feb 18, 2024

I hadn't seen the introduction on Buffer because it was hidden inside the JSDoc API PR #108, which I assumed was only adding documentation.

The buffer npm package is 2000 lines of JavaScript for a total of 26kB. Previously, esptool-js worked without it. @brianignacio5 can you explain why esptool-js needs this dependency?

Size and impact of bundling buffer npm package (via bundlephobia)
image

@brianignacio5
Copy link
Collaborator

Hi @balloob Sorry for late reply. There is a reference to atob and btoa which is supported in browsers but not in NodeJS environments.

I'm not sure of how to handle both cases since some users want to extend this tool for more environments (#117). I figured using a separated Buffer library might offer for both cases. Any ideas of a lighter solution for this ?

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

Successfully merging a pull request may close this issue.

2 participants