bun-file-io

Automate Bun file I/O for reading, writing, scanning, and deleting files.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes Bun-based file I/O usage across the project, providing a clear, opinionated pattern for reading, writing, scanning, and deleting files. It helps teams avoid ad-hoc Bun.file usage and ensures consistent behavior when dealing with directories and metadata.

Core Features & Use Cases

  • Unified Bun.file usage with read, json, exists, and delete helpers to interact with local files.
  • Directory and scan guidance using Bun.Glob and path utilities to enumerate files deterministically.
  • Interop guidance on when to prefer Bun APIs over node:fs for speed and reliability, and when to fallback to node:fs for directory-level tasks.
  • Use Case: Automate routine file maintenance in OpenCode projects, such as auditing, migrating, or preparing build assets.

Quick Start

Use this skill to read a sample file named 'example.txt' and write a greeting to 'hello.txt', illustrating Bun.file usage and safe write patterns.

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 using Bun in a server script?

Bun file I/O uses Bun.file to read text or JSON and Bun.write to output data safely. This standardizes local file operations for development workflows by providing consistent read, write, and delete helpers.

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

Bun directory scanning uses Bun.Glob and path utilities to enumerate files deterministically. This approach standardizes file discovery across project repos for auditing, migrating, or preparing build assets.

When should I prefer node:fs over Bun APIs for file system tasks?

You should prefer node:fs over Bun APIs for directory-level tasks where you need maximum reliability and speed. Use Bun file I/O for standard file operations and fallback to node:fs for complex directory management.

Can I use Bun file I/O to automate routine file maintenance across project repos?

Yes, Bun file I/O automates routine file maintenance like auditing, migrating, or preparing build assets. It provides a clear pattern for interacting with local files using Bun.file and Bun.write helpers.

Why does standardizing Bun file operations matter for development workflows?

Standardizing Bun file operations prevents ad-hoc Bun.file usage and ensures consistent behavior when dealing with directories and metadata. It provides an opinionated pattern for reading, writing, scanning, and deleting files.

Does Bun file I/O support checking if a file exists before reading?

Yes, Bun file I/O includes Bun.file.exists to check if a file exists before reading. This ensures safe file operations by verifying file presence before attempting to interact with local files.