home ~ projects ~ socials

Use Sharp To Process An Image

si

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
-- end of line --