aplbrain / npyjs

Read numpy .npy files in JavaScript
https://aplbrain.github.io/npyjs/
Apache License 2.0
77 stars 21 forks source link

feat: add browser compatibility #14

Closed WenheLI closed 3 years ago

WenheLI commented 3 years ago

hi @j6k4m8 ! Thanks for this great project! I am looking for a js library that could both run on node & browser which could read npy file.

I just made a small commit to make this library node & browser compatible. Comments are welcome!

Besides, I am working on another project that is to run/use data-processing & feature engineering ops within js. Here is the link: https://github.com/imgcook/datacook Let me know how you think!

WenheLI commented 3 years ago

humms. To make this a real browser&node compatible module, we should add a bundler as well.

j6k4m8 commented 3 years ago

Awesome @WenheLI — this is great! Thank you for adding. Ready to merge? (btw, datacook looks very cool!)

j6k4m8 commented 3 years ago

@WenheLI just wanted to make sure everything's up to date here and this is ready to merge in?

WenheLI commented 3 years ago

Sorry that saw this thread! I still have some commits to push, could you give me a bit time?

j6k4m8 commented 3 years ago

@WenheLI certainly, no rush! :)

1wheel commented 3 years ago

As is, this PR works just fine in node and the browser (a global npyjs is added in the browser if loaded without bundler)—I think it is ready to merge to fix #10.

j6k4m8 commented 3 years ago

@1wheel — thanks for the bump here!

1wheel commented 3 years ago

@j6k4m8 Thanks for the quick response! Would you mind also bumping on npm?

j6k4m8 commented 3 years ago

For sure, all done! v0.2.0 is now live on npm. (Sorry for the delay, was away from my computer earlier and merged from mobile!)