npm i -g ossr
Simplify
ossr -i <accessKeyId> -s <accessKeySecret> -b <bucket>
Advance
ossr -i <accessKeyId> -s <accessKeySecret> -b <bucket> -e <endpoint> -r <region> -t <timeout>
ossr ./localFile.jpg
------> https://xxxx/localFile.jpg
ossr ./localFolder
------> https://xxxx/onlineFolder/<localFolder**>
ossr ./localFile.jpg customFolder/renamedFile.jpg
------> https://xxxx/customFolder/renamedFile.jpg
ossr ./localFolder onlineFolder/
------> https://xxxx/onlineFolder/<localFolder**>
ossr -h
import * as ossr from "../bin/ossr";
async function test() {
// ossr.setConfig({
// accessKeyId: "",
// accessKeySecret: ""
// });
let existRes = false;
const uploadRes = await ossr.ossUpload("../bin", "ossr/");
// console.log(uploadRes);
existRes = await ossr.ossIsExist("ossr/ossr.js");
// console.log(existRes);
const deleteRes = await ossr.ossDelete("ossr/");
// console.log("deleteRes", deleteRes);
}
test()