@utoolkits/oss

0.0.5 • Public • Published

Request

1. 安装依赖

yarn add @utoolkits/oss
yarn add ali-oss
or
npm i @utoolkits/oss
npm i ali-oss

2. 初始化

import OSS from '@utoolkits/oss';
const oss = await OSS.init({
  env: '', // 环境变量
  prefix: '', // 模块标识
  token: '', // 登录的 Token
});
参数 默认值 描述
env 必传 test、prod
prefix 必传 home
token 必传 登录 token

3. 功能

3.1 上传文件

const res = await oss.put(file);

响应:

{
  name: "home/8/1_1683021348494.png",
  url: "http://haobo-oss.oss-cn-hangzhou.aliyuncs.com/home/8/1_1683021348494.png"
}

4. 参考

oss

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.51latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.51
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i @utoolkits/oss

Weekly Downloads

1

Version

0.0.5

License

none

Unpacked Size

15.9 kB

Total Files

13

Last publish

Collaborators

  • wang92