first of all my code works fine but I'm trying to improve it, simply I'm trying to request an image file from host then resize it with Jimp and finally upload it to my Cloudinary account. but before sending it to Cloudinary I'm actually keeping a copy on my desk then referencing the name. so I need to know how to use that image result coming from Jimp function then send it to Cloudinary with out keeping a copy on my drive ?
let imgURL =
"https://s3-eu-central-1.amazonaws.com/salla-cdn/FY1gllCm5QiMxstupKHqCkNOWuUxWn0jYqrBLrFI.jpeg";
const imgArr = imgURL.split("/");
const imageName = imgArr[imgArr.length - 1];
Jimp.read(imgURL)
.then(image => {
image.resize(500, 500).write(`./ready/${imageName}`);//RESIZING DONE
//START UPLOADING
cloudinary.uploader.upload(
`./ready/${imageName}`,
{
crop: "limit",
tags: "samples",
use_filename: true,
unique_filename: false
},
function(result) {
console.log(result);
}
);
})
.catch(err => {
console.log(err);
});