Bun File I/O

•
239
•

Optimizes file system operations in Bun using native primitives like Bun.file, Bun.write, streaming, and fast glob patterns.

The Bun File I/O skill equips Claude Code with deep knowledge of Bun's high-performance native file system APIs. It guides developers through utilizing Bun.file() for zero-copy reads, Bun.write() for blazing-fast writes, streaming pipelines, directory management, and Bun.Glob directory scanning. By replacing legacy Node.js fs paradigms with Bun-optimized patterns, this skill ensures clean, production-ready, and resource-efficient file handling in JavaScript and TypeScript backend projects.

Key Features

01Fast filesystem directory matching with the native Bun.Glob API
02Native Bun.file() reads for text, JSON, ArrayBuffer, and Uint8Array bytes
03Directory inspection, file watching, and path normalization utilities
04High-speed Bun.write() operations supporting buffers, strings, and Web Responses
05239 GitHub stars
06Stream piping and chunk processing with Bun writers and TransformStreams

Use Cases

01Building high-throughput backend services that stream and process large files
02Writing efficient build scripts and CLI tools with pattern matching and fast globbing
03Migrating Node.js fs/promises file handling code to native, high-performance Bun APIs