bun-file-io

Read, write, scan, and delete files using Bun.file and Bun.write APIs.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/jaraim/opencode-chinese --skill bun-file-io-jaraim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bun-file-io
Source: https://github.com/jaraim/opencode-chinese/tree/main/.opencode/skill/bun-file-io
Command: npx skills add https://github.com/jaraim/opencode-chinese --skill bun-file-io-jaraim

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a unified, concise workflow for Bun-based file I/O, covering common tasks like reading, writing, scanning, and deleting files to reduce boilerplate.

Core Features & Use Cases

  • Bun.file API guide: read lazily, check exists, query metadata like size and type, and use file.writer for incremental writes.
  • Common patterns: read text, read binary, and directory traversal to simplify script-driven file operations.
  • Use Case: automatically scan a project directory, purge temp files, and log the results during build or initialization.

Quick Start

Use the bun-file-io skill to read the contents of '/path/to/file.txt' and write the content to '/path/to/destination.txt'.

Frequently Asked Questions about bun-file-io

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read and write files in Bun?

To read and write files in Bun, use the Bun.file API to lazily read text or binary content, and use Bun.write to output that data to a destination path. This approach reduces boilerplate for common file operations.

Can I scan a project directory and delete temp files using Bun?

Yes, you can scan a project directory and delete temp files using Bun by applying directory traversal patterns to identify targets, removing the files, and logging the results during build or initialization scripts.

Does Bun support incremental writes for large files?

Bun supports incremental writes for large files by using the file.writer API. This allows you to stream data to a file progressively rather than loading the entire payload into memory at once.

How do I check file metadata like size and type in Bun?

You can check file metadata like size and type in Bun by using the Bun.file API. It allows you to query file properties and check if a file exists without reading the entire contents into memory.

What is the best way to handle file I/O in a Bun runtime?

The best way to handle file I/O in a Bun runtime is using the native Bun.file and Bun.write APIs. They provide a unified workflow for reading, writing, scanning, and deleting files with minimal boilerplate.

Do I need Node.js compatibility to perform file operations with Bun?

No, you do not need Node.js compatibility layers. This skill requires the Bun runtime and directly exposes guidance for using Bun.file, Bun.write, and related APIs to manipulate project directories and assets.