nodejs-mobile / nodejs-mobile-react-native

Node.js for Mobile Apps React Native plugin
https://nodejs-mobile.github.io
MIT License
178 stars 43 forks source link

Q: Is it possible to use react-native packages in the Node layer? #32

Open spsaucier opened 1 year ago

spsaucier commented 1 year ago

In particular, I'd like to use https://github.com/itinance/react-native-fs and https://github.com/bamlab/react-native-image-resizer.

If not, would Node's fs and https://github.com/lovell/sharp work for that (manipulating images in storage) in this layer?

staltz commented 1 year ago

Why do you want to use react-native-fs in Node when you can just use fs?

And for resizing images, sharp in theory would work but it's a native module so you will have to make sure it compiles correctly for Android (arm / arm64) and iOS (arm64), which depending on the case can be complex. You can also use pure JS modules that manipulate images, like jimp.

LeandroGeorge commented 1 year ago

I'm also looking for a way to use a react native package (ffmpeg-kit) in the node layer.