yarn add ali-oss
two。 Connect to the OSS:
const client = new OSS({
accessKeyId: 'xxx',
accessKeySecret: 'yyy',
bucket: 'your-bucket',
region: 'oss-cn-hangzhou',
})
put (path, Buffer)
const buf = await promisify(readFile)('./hello.txt')
await client.put(`/dir/test.txt`, buf)