mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
This adds a new `unzipSync` function to the Bun runtime that allows
synchronous extraction of ZIP files. The implementation:
- Uses Zig's std.zip library for robust ZIP parsing
- Returns the first file found as a Uint8Array (simplified for initial version)
- Includes security measures to prevent directory traversal attacks
- Handles deflate and store compression methods
- Provides comprehensive error handling for malformed ZIP files
API Usage:
```javascript
import { unzipSync } from "bun";
const data = unzipSync(zipBuffer);
```
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>