partzilla
v1.2.0
Published
<p background="rgb(57, 59, 58)" align="center"> <img align="center" height="300" src="https://raw.githubusercontent.com/mtsewrs/partzilla/refs/heads/master/assets/partzilla.webp" /> </p>
Readme
Install
pnpm install partzilla
bun install partzilla
yarn install partzilla
npm install partzillaUsage node
import { partzilla } from "partzilla";
createServer(async (req, res) => {
const files = partzilla(req);
await multipart.next(async (file) => {
// file is of type MultipartFile
console.log(file.name);
console.log(file.filename);
console.log(file.contentType);
const stream = file.stream(); // ReadableStream
});
res.end("Node!");
});Usage bun
import { partzilla } from "partzilla";
Bun.serve({
async fetch(req) {
const files = partzilla(req);
await multipart.next(async (file) => {
// file is of type MultipartFile
console.log(file.name);
console.log(file.filename);
console.log(file.contentType);
const stream = file.stream(); // ReadableStream
});
return new Response("Bun!");
},
});MultipartFile
interface MultipartFile {
name?: string;
filename?: string;
contentType?: string;
stream(): ReadableStream<Buffer>;
}