🚀 DAY 4 OF LAUNCH WEEK:Introducing Socket Scanning for OpenVSX Extensions.Learn more
Socket
Book a DemoInstallSign in
Socket

@kokojs/plugin-ufile

Package Overview
Dependencies
Maintainers
4
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kokojs/plugin-ufile

用于上传文件到 [ufile 对象存储空间](https://doc.qima-inc.com/pages/viewpage.action?pageId=12987820)。

latest
npmnpm
Version
4.0.35
Version published
Maintainers
4
Created
Source

Ufile 插件

用于上传文件到 ufile 对象存储空间

安装

yarn add @kokojs/plugin-ufile --dev

安装完成后,在 koko.config.js 中添加如下配置:

module.exports = {
  plugins: {
    ufile: {},
  },
};

配置项

sourcePath

  • Type: string
  • Default: path.resolve(process.cwd(), 'dist')

配置源文件地址路径,目录 / 文件。如果是目录会使用 tar 压缩后上传。

tarballPath

  • Type: string
  • Default: path.resolve(process.cwd(), 'dist.tar.gz')

压缩文件输出路径。

filename

  • Type: string
  • Default: dist-[contenthash].tar.gz

上传文件名称,[contenthash] 会被替换为文件内容的 hash 值。如果不使用 hash,将会导致同名文件被覆盖。

outputFile

  • Type: string
  • Default: path.resolve(process.cwd(), 'ufile.json')

上传完成后,会将返回值保存在此文件中。如果error不为空,则上传发生错误。

{
  "error": "",
  "downloadUrl": "",
  "filename": ""
}

fetchAuthConfigApi

  • Type: string
  • Default: ``

可以获取 bucket privateKey publicKey domain 的接口,返回值为 json

{
  "bucket": "",
  "publicKey": "",
  "privateKey": "",
  "domain": ""
}

命令

执行 koko ufile 命令有四个参数。这些参数为了安全不建议保存在源码中,所以需要通过 命令行参数/接口 的方式传入。

如果没有配置 fetchAuthConfigApi,则命令必须传下面的参数

  • --bucket : ufile 空间名称
  • --privateKey : 空间私钥
  • --publicKey : 空间公钥
  • --domain : 空间域名

示例

koko ufile --bucket xxx --publicKey xxx --privateKey xxx --domain xxx.ufileos.com

维护者

Jake(于成杰)、陈嘉涵。

FAQs

Package last updated on 01 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts