Skip to content

Commit

Permalink
👌 IMPROVE: Syntax + Docs (#757)
Browse files Browse the repository at this point in the history
* 👌 IMPROVE: Syntax + Docs

* 👌 IMPROVE: Await the writeAsync method
  • Loading branch information
ahmadawais authored and hipstersmoothie committed Aug 17, 2019
1 parent 4c8088d commit e0978bb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/plugin-resize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ Resizes the image to a set width and height using a 2-pass bilinear algorithm/
import jimp from 'jimp';

async function main() {
const image = await jimp.read('test/image.png');
// Read the image.
const image = await jimp.read('test/image.png');

image.resize(150, jimp.AUTO);
// Resize the image to width 150 and auto height.
await image.resize(150, jimp.AUTO);

// Save and overwrite the image
await image.writeAsync('test/image.png');
}

main();
Expand Down

0 comments on commit e0978bb

Please sign in to comment.