Skip to content

Commit 047990c

Browse files
authored
Update packages/multipart-parser/src/lib/multipart.ts
1 parent 6125c15 commit 047990c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/multipart-parser/src/lib/multipart.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ export interface ParseMultipartOptions {
6262
*
6363
*/
6464
useContentPart?: boolean
65+
/**
66+
* A callback called for each multipart part created. This is called immediately after the header is parsed, and before any body chunks are processed, including the partial chunk after the header.
67+
*
68+
* If you want to immediately write chunks to the file system, set useContentPart to false, and then set the part.append method of each part this callback is called with. part.append will be called with each chunk, including partial chunks, after the returned promise resolves, and before the iterator yields the completed chunk.
69+
*
70+
* This callback and part.append are both awaited.
71+
*
72+
*/
6573
onCreatePart?(part: MultipartPart): Promise<void> | void
6674
}
6775

0 commit comments

Comments
 (0)