bun-file-io

Standardize file I/O using Bun.file, Bun.write, and Bun.Glob APIs.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/aniwei/vitamin-code --skill bun-file-io-aniwei
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bun-file-io
Source: https://github.com/aniwei/vitamin-code/tree/main/refs/opencode/.opencode/skill/bun-file-io
Command: npx skills add https://github.com/aniwei/vitamin-code --skill bun-file-io-aniwei

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes Bun-based file I/O operations across a project, covering reading, writing, scanning, and deletion patterns, and highlights when to prefer Bun APIs over Node fs for directories.

Core Features & Use Cases

  • Bun.file-based operations: read, write, exists, and directory handling with Bun.file(...).
  • Prefer Bun APIs over Node fs for file access, with guidance on when to fall back to node:fs.
  • Scanning and batch operations using Bun.Glob and related utilities for deterministic tasks.

Quick Start

Use this skill to read a text file named 'config.txt', append a line, and verify existence with Bun.file(...).exists().

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 using Bun.file?

Bun file I/O standardizes reading and writing files using Bun.file and Bun.write APIs, providing safe and deterministic file manipulation across your project.

When should I use Bun file APIs instead of node:fs?

Prefer Bun APIs for efficient file access and directory handling, falling back to node:fs only when specific directory handling features are missing from native Bun APIs.

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

Use Bun.Glob and related utilities to execute deterministic scanning and batch operations, yielding safely matched file paths for subsequent manipulation.

How do I check if a file exists using Bun?

Validate file existence efficiently by calling Bun.file(...).exists() within your standardized Bun file I/O workflow.

Can I append text to an existing file with Bun.write?

Yes, you can append text to an existing file using Bun.write alongside Bun.file operations to read and modify content deterministically.