foliojs / png.js

A (animated) PNG decoder in JavaScript for the HTML5 canvas element and Node.js
http://devongovett.github.com/png.js
MIT License
489 stars 92 forks source link

feat: esm and cjs builds for node and browser #81

Open diegomura opened 5 months ago

diegomura commented 5 months ago

Hi @devongovett ! Hope you are doing good.

I'd like to start using foliojs packages again in react-pdf. I gradually moved away from them due to several reasons, among them because node deps in foliojs repos. This includes pdfkit and png-js.

Here's my fork. This is the same node entrypoint here but bundled with rollup to generate node and browser entrypoints. Node ones are just like the existing ones. For browser though, we remove fs dependency and ignore methods that use it, and replace zlib with browserify-zlib.

Not sure who's responsible of reviewing and publishing (I have merge rights here, but not publishing to npm) but this first step would be very helpful towards start unifying foliojs with react-pdf 😄

diegomura commented 4 months ago

Thanks for the review @blikblum ! when can we expect to have this merged?

blikblum commented 4 months ago

Need one more review