Use Sharp To Process An Image

October - 2021
const sharp = require("sharp");

sharp("input.jpg")
  .resize({ width: 1024, height: 768 })
  .toFile("output.jpg")

More details here: https://sharp.pixelplumbing.com/api-resize


Installation is done with:

Install with:

npm install sharp
# or
yarn add sharp