I want to resize and compress images using sharp in node.js
In sharp for jpeg there is separate compression and for webp there is separate and for png there is separate.
WEBP
sharp('a.jpg')
.resize(1000)
.webp({quality: 80})
JPEG
sharp('_4_.jpg')
 .resize(1000)
 .jpeg({quality: 80})
PNG
sharp('_4_.jpg')
 .resize(1000)
 .png({compressionLevel: 8})
Basically I want to compress and resize image without checking in which format they.
Is there anything for that in sharp ?
 
     
     
     
     
    