ufile-rest
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

ufile-rest

ufile官方的node sdk实现比较悲惨……

接口参数和返回参考https://docs.ucloud.cn/api/ufile-api/index

Documentation

Usage

import {Ufile} from 'ufile-rest'

const ufile = new UFile({
  pubKey: process.env.PUB_KEY,
  priKey: process.env.PRI_KEY,
  bucketName: process.env.BUCKET_NAME,
  region: 'cn-bj',
})

const res = await ufile.prefixFileList()
console.log(res)

Call UFile Api Direct

const res = await ufile.got.get('/file.bin')

Options available in Got Options

Authorization header can be calculated automatic.

Get sign for front-end direct upload

const sign = ufile.getSign('POST', '/file.bin')

Readme

Keywords

Package Sidebar

Install

npm i ufile-rest

Weekly Downloads

28

Version

1.5.1

License

MIT

Unpacked Size

36.7 kB

Total Files

8

Last publish

Collaborators

  • bangbang93