How to use webp-converter (npm module) in react?

463 views Asked by At

I have used webp-converter node.js module to convert image formats. I tested this with nodejs in the console. It works. But how do I use this module in react?

1

There are 1 answers

0
Escaper On BEST ANSWER

I just tried to use it in my React project and it turns out the module is trying to do a system call with exec() which does not work on the client-side. This leads me to believe that this module is only for usecases where the conversion would happen at the server-side. So the answer is: You can't.