@teambun/qcup

Efficient file uploader for QCloud.

Usage no npm install needed!

<script type="module">
  import teambunQcup from 'https://cdn.skypack.dev/@teambun/qcup';
</script>

README

qcup

code style: prettier

Efficient file uploader for QCloud.

Features

  • Concurrency Support
  • Report Sheet
  • Enable / Disable / Customize HTTP Cache

Installation

$ npm install -g @teambun/qcup

Config

$ qcup gen-config

After generating ~/.qcuprc.js, read instructions in the file, set it properly.

Usage

$ qcup --help

Cache Policy

Default cache policy for development without --cache option:

File Type / File Name Expire
All 60 seconds

Cache policy for production with --cache auto option:

File Type / File Name Expire
Type - HTML 60 seconds
Type - Others 1 year

Cache policy for files in certain pattern:

File Type / File Name Expire
Name - /\.stale\./ 60 seconds

Customize cache policy with --cache option, such as:

  • --cache 0: disable cache.
  • --cache 3600: set cache time to 1 hour.

Programmatic API

async function qcup(sourceDirectory, targetDirectory, concurrency, config, interactive, cache)

Argument Type Default Value
sourceDirectory String NA
targetDirectory String NA
concurrency Number 5
config Object{ AppId, SecretId, SecretKey, Bucket, Region } NA
interactive Boolean true
cache Number NA

LICENSE

MIT