#Node -> Browser friendly package?

7 messages · Page 1 of 1 (latest)

pearl sluice
#

Whats the way to "browserify" a package these days? I have a package I wrote that I need to be made available to the browser, its using "zlib" and Buffer.

#

I'd rather bundle it myself and not rely on something like skypack

coral abyss
#

the right way would be to use APIs that are available both in the browser and in nodejs
I'm mainly talking about using ArrayBuffer instead of Buffer

#

for zlib, there is zlib-browserify which you need to install to do the mocks and pollyfills

coral abyss
#

that's because it relies on Pako, a package to do compression, and not the native zlib module

#

I'd recommend switching entierly to pako, and using that, for the frontend as well as for the backend