Skip to content

Create ReadableStreams from multipart forms without allocating the entire form on the heap

Notifications You must be signed in to change notification settings

zebp/multipart-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multipart-stream

Create ReadableStreams from multipart forms without allocating the entire form on the heap.

Example

import { streamFromMultipart } from "https://deno.land/x/multipart_stream/mod.ts";

const [stream, boundary] = streamFromMultipart(async (multipartWriter) => {
  const file = await Deno.open("test.bin");
  await multipartWriter.writeFile("file", "test.bin", file);
  file.close();
});

await fetch("http://example.com/upload", {
  headers: {
    "Content-Type": `multipart/form-data; boundary=${boundary}`,
  },
  body: stream,
  method: "POST",
});

About

Create ReadableStreams from multipart forms without allocating the entire form on the heap

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published