simple-zip-async
Version:
旨在简化前端下载打包流程
54 lines (43 loc) • 993 B
Markdown
# simple-zip-async
旨在简化前端下载打包流程
## 准备数据结构
| 参数 | 类型 | 描述 |
| ----- | ------ | ------------ |
| url | string | 远端地址 |
| files | array | 要打包的文件 |
- files
| 参数 | 类型 | 描述 |
| ------- | ------- | ------ |
| name | string | 文件名 |
| binary | boolean | 二进制 |
| content | array | 文本 |
> content
>
> 数组元素中一项对应到文本到一行
```json
[
{
"url": "https://xxxx/xxx/SouthCoast.jpg",
"files": [
{
"name": "SouthCoast.jpg",
"binary": true
},
{
"name": "SouthCoast.txt",
"binary": false,
"content": [
"图片ID:480",
"图片标题:SouthCoast",
"图片描述:塞里雅兰瀑布后的午夜太阳,冰岛南海岸附近"
]
}
]
}
]
```
## 使用
```js
import simpleZip from "../dist/index";
simpleZip(jsonList);
```