request-npm

Download image and resize in nodejs

随声附和 提交于 2021-01-29 17:50:33
问题 What I am trying to do is download an image from google into my system repository in the project folder /download . Next, I am trying to get the image from the download repository and resize and again save the resized image in /thumbnail repository. Below is the code which I have written //Google URL var mainuri = 'http://images.sadhguru.org/sites/default/files/media_files/iso/en/64083-natures-temples.jpg'; var dir = './download'; if (!fs.existsSync(dir)){ fs.mkdirSync(dir); } // CODE TO