Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zebp/multipart-stream
Create ReadableStreams from multipart forms without allocating the entire form on the heap
https://github.com/zebp/multipart-stream
deno typescript
Last synced: 4 months ago
JSON representation
Create ReadableStreams from multipart forms without allocating the entire form on the heap
- Host: GitHub
- URL: https://github.com/zebp/multipart-stream
- Owner: zebp
- Created: 2021-04-26T20:46:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-27T12:57:17.000Z (almost 4 years ago)
- Last Synced: 2024-10-17T18:46:36.023Z (4 months ago)
- Topics: deno, typescript
- Language: TypeScript
- Homepage:
- Size: 2.93 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# multipart-stream
Create ReadableStreams from multipart forms without allocating the entire form
on the heap.## Example
```typescript
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",
});
```