bun-fs-helpers

Perform Bun-native filesystem operations with command-injection-safe Bun.spawn array arguments.

2|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/nathanvale/side-quest-marketplace --skill bun-fs-helpers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bun-fs-helpers
Source: https://github.com/nathanvale/side-quest-marketplace/tree/main/plugins/dev-toolkit/skills/bun-fs-helpers
Command: npx skills add https://github.com/nathanvale/side-quest-marketplace --skill bun-fs-helpers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pure Bun-native filesystem utilities to avoid node:fs, reduce command injection risk, and improve token efficiency.

Core Features & Use Cases

  • File existence & reads: pathExists, readTextFile, readJsonFile with Bun.file() or shell-backed fallbacks.
  • Writing & hashing: writeTextFile, writeJsonFile, sha256, sha256File.
  • Directory & path utils: ensureDir, readDir, stat, deep equality checks.
  • Security: Command-injection-safe practices using Bun.spawnSync with array args.

Quick Start

Use Bun FS Helpers to perform common file operations without node:fs.

Frequently Asked Questions about bun-fs-helpers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform filesystem operations safely without command injection risk in Bun?

Bun-native filesystem helpers use Bun.spawn with array arguments and Bun.file() to eliminate command injection vectors. They provide pathExists, readTextFile, writeTextFile, and directory operations with zero node:fs dependencies, ensuring safe file handling in Bun-first environments.

Can I read and write JSON files with Bun without relying on node:fs?

Yes. readJsonFile and writeJsonFile use Bun.file() for pure Bun-native JSON operations. Both async and sync variants are available, reducing token overhead and eliminating Node.js filesystem module dependencies.

How do I check if a file or directory exists and perform safe file operations in Bun?

Use pathExists to check file presence and stat for detailed metadata. TOCTOU protection via stat before and after operations prevents race conditions in automation, tooling, and build workflows.

What filesystem operations does Bun natively support for build workflows and automation?

Bun-native helpers cover file existence checks, reading and writing text and JSON, copying and moving files, deleting, listing directories, SHA256 hashing, and deep equality checks—all designed for build and automation tasks without external dependencies.

Does Bun provide command-injection-safe utilities for directory operations?

Yes. ensureDir and readDir use Bun.spawnSync with array arguments to prevent injection. These utilities safely create, list, and traverse directories in Bun-first environments.

How do I hash files securely in Bun for build pipelines?

sha256 and sha256File provide command-injection-safe hashing using Bun-native utilities. Both functions support fast file verification and integrity checks in build and automation workflows.