NodeMultipart.ts
NodeMultipart.ts overview
Section titled “NodeMultipart.ts overview”Node.js multipart parsing for HTTP multipart/form-data request bodies.
NodeMultipart adapts a Node Readable plus incoming HTTP headers into
Effect’s shared multipart model. It can expose form parts as a stream or
collect a complete persisted form by writing file uploads to scoped temporary
files through the current FileSystem and Path services. fileToReadable
returns the underlying Node readable stream for file parts produced by this
parser.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”persisted
Section titled “persisted”Parses multipart data from a Node readable request body and persists file
parts using the current FileSystem, Path, and Scope services.
Signature
declare const persisted: ( source: Readable, headers: IncomingHttpHeaders) => Effect.Effect<Multipart.Persisted, Multipart.MultipartError, Scope.Scope | FileSystem.FileSystem | Path.Path>Since v4.0.0
stream
Section titled “stream”Parses multipart data from a Node readable request body and headers into a
stream of Multipart.Part values, converting parser failures to
MultipartError.
Signature
declare const stream: ( source: Readable, headers: IncomingHttpHeaders) => Stream.Stream<Multipart.Part, Multipart.MultipartError>Since v4.0.0
converting
Section titled “converting”fileToReadable
Section titled “fileToReadable”Returns the underlying Node readable stream for a multipart file produced by the Node multipart parser.
Signature
declare const fileToReadable: (file: Multipart.File) => ReadableSince v4.0.0