bun-file-io

Standardize file reading, writing, scanning, and deletion with Bun APIs.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/aidansunbury/docs-agent --skill bun-file-io-aidansunbury
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bun-file-io
Source: https://github.com/aidansunbury/docs-agent/tree/main/resources/opencode/.opencode/skill/bun-file-io
Command: npx skills add https://github.com/aidansunbury/docs-agent --skill bun-file-io-aidansunbury

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes Bun-based file I/O, helping developers read, write, scan, and delete files efficiently while guiding when to prefer Bun APIs over Node fs.

Core Features & Use Cases

  • Use Bun.file for lazy file reads and existence checks.
  • Use Bun.write for writing and incremental writes to large files.
  • Use Bun.Glob for file scans and directory discovery.
  • Guidance on when to revert to node:fs for directories or compatibility scenarios.

Quick Start

Read a text file using bun-file-io and save the content to a new file.

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 efficiently in Bun?▼

Use Bun.file for lazy file reads and Bun.write for writing content. This standardizes local filesystem tasks and speeds up Bun workflows by enforcing Bun APIs over node:fs.

What is the best way to scan directories and find files in Bun?▼

Use Bun.Glob for file scans and directory discovery. It handles filesystem searches across directories efficiently, standardizing batch reads and cleanup operations in Bun scripts.

Does Bun file I/O replace node:fs for all filesystem operations?▼

Bun file I/O does not completely replace node:fs. You should prefer Bun APIs for reading, writing, and scanning, but revert to node:fs for specific directory operations or compatibility scenarios.

Can I perform safe file existence checks and batch reads with Bun?▼

Yes, you can perform safe existence checks and batch reads with Bun. Use Bun.file to check if a file exists and read its content lazily, which optimizes filesystem management across directories.

When should I use Bun.write instead of node:fs for writing files?▼

Use Bun.write instead of node:fs when you need to write files or perform incremental writes to large files. It is standardized for Bun-powered scripts and tooling to ensure faster workflows.