Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
976977577 committed Aug 26, 2023
1 parent 4ee2731 commit b8eaffd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ uploadFile(@UploadedFile() file: MemoryStorageFile) {

### 数组文件

`FileInterceptor` 参数:
`FilesInterceptor` 参数:

- `fieldname`: string - 包含文件的字段的名称

- `maxCount`: number - 可选的数字 - 接受的文件的最大数量

- `options`: 可选的 [`UploadOptions`](src/multipart/options.ts#L5) 类型对象
```ts
Expand All @@ -73,15 +75,14 @@ uploadFile(@UploadedFiles() files: MemoryStorageFile[]) {

### 多个文件

`FilesInterceptor` 参数:

- `fieldname`: string - 包含文件的字段的名称
`FileFieldsInterceptor` 参数:

- `maxCount`: 可选的数字 - 接受的文件的最大数量
- `uploadFields`: 类型为 [`UploadField`](src/multipart/handlers/file-fields.ts#L11) 的数组对象

- `options`: 可选的 [`UploadOptions`](src/multipart/options.ts#L5) 类型对象

```ts


import { FileFieldsInterceptor, UploadedFiles, MemoryStorageFile } from 'nest-file-fastify';

@Post('upload')
Expand All @@ -94,12 +95,6 @@ uploadFile(@UploadedFiles() files: { avatar?: MemoryStorageFile[], background?:
}
```

`FileFieldsInterceptor` 参数:

- `uploadFields`: 类型为 [`UploadField`](src/multipart/handlers/file-fields.ts#L10) 的对象

- `options`: 可选的 [`UploadOptions`](src/multipart/options.ts#L5) 类型对象


### 任意文件

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nest-file-fastify",
"version": "3.0.3",
"version": "3.0.5",
"description": "@fastify/multipart decorators for Nest.js",
"license": "MIT",
"main": "build/src/index.js",
Expand Down Expand Up @@ -29,7 +29,8 @@
"build": "tsc --p tsconfig.lib.json",
"lint": "eslint \"src/**\" --ext \".js,.jsx,.ts,.tsx\"",
"lint:fix": "npm run lint -- --fix",
"clean": "rimraf build"
"clean": "rimraf build",
"prepublishOnly": "yarn clean && npm run build"
},
"devDependencies": {
"@fastify/multipart": "^7.7.3",
Expand Down

0 comments on commit b8eaffd

Please sign in to comment.