npm i mrnima-temporary-uploader
const mrnimaTemporaryUploader = require("mrnima-temporary-uploader");
// use file buffer for upload files.
const fs = require("fs");
async function UPLOAD_TEST() {
var buffer = fs.readFileSync("./img.png");
const result = await mrnimaTemporaryUploader.upload(buffer);
console.log(result)
}
UPLOAD_TEST()
async function UPLOAD_TEST_URL() {
var response = await axios({
method: "get",
url: "https://tmpfiles.org/dl/13992108/mrnima-temporary-uploader.jpg", // file direct link
responseType: "arraybuffer"
})
const buffer = response.data;
const result = await mrnimaTemporaryUploader.upload(buffer);
console.log(result)
}
UPLOAD_TEST_URL()
{
"creator": "MR NIMA",
"status": true,
"result": "https://tmpfiles.org/dl/13992667/mrnima-temporary-uploader.jpg"
}