@teambun/qcup
v2.0.1
Published
Efficient file uploader for QCloud.
Readme
qcup
Efficient file uploader for QCloud.
Features
- Concurrency Support
- Report Sheet
- Enable / Disable / Customize HTTP Cache
Installation
$ npm install -g @teambun/qcupConfig
$ qcup gen-configAfter generating ~/.qcuprc.js, read instructions in the file, set it properly.
Usage
$ qcup --helpCache 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
