Skip to content
mtsewrsPublic

About

Multipart parser for node and bun

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

⚡️ Modern multipart parser written in rust and typescript for node and bun

NPM Version NPM Downloads

Install

pnpm install partzilla
bun install partzilla
yarn install partzilla
npm install partzilla

Usage 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>;
}

About

Multipart parser for node and bun

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages