Class for parsing multipart/form-data encoded data

Hierarchy

  • MultiPartParser

Constructors

  • Parameters

    • req: IncomingMessage

      IncomingMessage that will be parsed in a series of chunks

    • Optional persistence: boolean

      If true, files will be directly written to disk and returned with a file path. Otherwise, files will be accumulated in memory into strings

    • Optional rawStrings: boolean

      If true, non-file formdata will be returned as raw strings instead of parsed as JSON objects

    Returns MultiPartParser

Properties

boundary: string = ""
buffer: string = ""
error: boolean
file: FileHandle
multipartData: Record<string, unknown> = {}
persistence?: boolean
precedingPartialPart: string = ""
rawStrings?: boolean
readingHeader: boolean = true
simpleFile: SimpleFile = ...
terminus: string = ""

Methods

  • Returns the current Record<string, unknown> representing data-parsed so far

    Returns Record<string, unknown>

Generated using TypeDoc