bun-file-io

Automate file read, write, scan, and delete operations with Bun.file APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers accelerate file I/O work by standardizing Bun.file usage for common tasks like reading, writing, scanning, and deleting files, and by clarifying when to defer to filesystem helpers for directory operations.

Core Features & Use Cases

  • Consistent Bun.file APIs for text, JSON, streams, and binary reads.
  • Safe file existence checks and path resolution to avoid common errors.
  • Practical examples for config loading, log rotation, and directory scanning.

Quick Start

Use Bun.file(path) to access a file and call the appropriate method (e.g., text or write) to perform the operation.

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 safely?

To read and write files in Bun safely, use Bun.file(path) APIs for text, JSON, and binary operations, which enforce safe path resolution and existence checks to prevent common filesystem errors.

When should I use Bun.file instead of node:fs for file operations?

Use Bun.file for direct file reads, writes, and existence checks, but defer to node:fs filesystem helpers when you need to perform complex directory operations or scans that Bun.file does not cover.

What is the best way to scan directories and delete files using Bun?

The best way to scan directories and delete files using Bun involves applying Bun.file APIs for targeted file deletion while utilizing node:fs helpers for broader directory scanning tasks.

Can I load JSON config files and rotate logs with Bun.file APIs?

Yes, you can load JSON config files and rotate logs with Bun.file APIs, which provide consistent streaming and text reading patterns tailored for these common Bun project workflows.