https://github.com/mtsewrs/partzilla
Multipart parser for node and bun
https://github.com/mtsewrs/partzilla
bun library multipart node nodejs npm-package parser rust typescript
Last synced: 4 months ago
JSON representation
Multipart parser for node and bun
- Host: GitHub
- URL: https://github.com/mtsewrs/partzilla
- Owner: mtsewrs
- Created: 2024-10-19T17:50:52.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-31T11:13:08.000Z (about 1 year ago)
- Last Synced: 2025-08-09T13:02:00.809Z (11 months ago)
- Topics: bun, library, multipart, node, nodejs, npm-package, parser, rust, typescript
- Language: JavaScript
- Homepage:
- Size: 292 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
⚡️ Modern multipart parser written in rust and typescript for node and bun
## Install
```bash
pnpm install partzilla
bun install partzilla
yarn install partzilla
npm install partzilla
```
## Usage node
```typescript
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
```typescript
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
```typescript
interface MultipartFile {
name?: string;
filename?: string;
contentType?: string;
stream(): ReadableStream;
}
```