bun-file-io

Automate file I/O tasks using Bun APIs for safe path handling.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/Zidane786/os-coding-agents --skill bun-file-io-zidane786
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bun-file-io
Source: https://github.com/Zidane786/os-coding-agents/tree/main/opencode/.opencode/skill/bun-file-io
Command: npx skills add https://github.com/Zidane786/os-coding-agents --skill bun-file-io-zidane786

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates and standardizes common file I/O tasks across Bun and Node to reduce boilerplate and avoid errors in file manipulation.

Core Features & Use Cases

  • Bun-first file access: read, write, delete, and scan files efficiently with Bun.file, Bun.write, and Bun.Glob.
  • Directory handling: create, list, and traverse directories safely, with path joins and exist checks.
  • Operational patterns: prefer Bun APIs over Node fs, verify existence before reading, and decode stream outputs when needed.

Quick Start

Use Bun.file to read a file, modify its contents, and save changes with Bun.write.

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 without boilerplate?

To read and write files in Bun, use Bun.file to access contents and Bun.write to save modifications. This approach reduces boilerplate and standardizes file I/O operations across Bun and Node environments.

What is the best way to handle directory traversal and creation in Bun?

Handling directories in Bun involves using Bun.Glob to scan files and safe path joins for traversal. You can create, list, and traverse directories securely by verifying existence before performing operations.

Can I use Bun file I/O APIs in a Node environment?

Yes, Bun file I/O APIs apply to Node environments that manipulate files and directories. The operational patterns prefer Bun APIs over Node fs to reduce errors and boilerplate across both runtimes.

Does Bun file I/O verify file existence before reading?

Yes, Bun file I/O operational patterns verify existence before reading files to prevent errors. Safe path handling and existence checks are applied before attempting to access or modify directory contents.

Why prefer Bun APIs over Node fs for file operations?

Preferring Bun APIs over Node fs for file operations reduces boilerplate and standardizes manipulation tasks. Bun.file, Bun.write, and Bun.Glob provide efficient, unified access for reading, writing, and scanning files.