I am developing a web application in node js with express, among its many functions I need to implement a small form to add products, with fields such as name, price, stock. just as I require an input in a form that allows me to upload a photo per product and when I receive it, I transform it into a webp type and after that I send it to the server where it can be stored with a unique code, I already have the entire form but I'm not sure how to send the change the photo in a format (so they can upload any compatible format and on the server it will still be saved as webp type), I tried implementing multer, but I didn't find any concise way to do it, is there any middleware ? or any concise and not too complicated way to do it? I also attach the dependencies that I have at the moment
const express = require('express');
const morgan = require('morgan');
const path = require('path');
const { engine } = require('express-handlebars');
const favicon = require('serve-favicon');
const session = require('express-session');
const MySQLStorage = require('express-mysql-session');
const flash = require('connect-flash');
const passport = require('passport');