jutsu-bun:bun-runtime

Implement Bun runtime operations for file I/O, HTTP servers, and native APIs.

187|20|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/TheBushidoCollective/han --skill jutsu-bun-bun-runtime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jutsu-bun:bun-runtime
Source: https://github.com/TheBushidoCollective/han/tree/main/jutsu/jutsu-bun/skills/bun-runtime
Command: npx skills add https://github.com/TheBushidoCollective/han --skill jutsu-bun-bun-runtime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill covers Bun's modern runtime APIs for file I/O, HTTP servers, environment access, and shell integration.

Core Features & Use Cases

  • File I/O & HTTP: Fast file reads/writes and building high-performance HTTP servers.
  • Environment Safety: Type-safe environment variable access.
  • Shell Integration: Use Bun.$ for shell commands within code.

Quick Start

Build a tiny HTTP server using Bun.serve and read a JSON file from disk.

Frequently Asked Questions about jutsu-bun:bun-runtime

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

FAQPage Schema
How do I build a fast HTTP server with Bun?

Bun.serve enables ultra-fast HTTP server creation with native APIs. Use Bun.serve to define request handlers, specify port and hostname, and serve connections. It supports WebSocket upgrades and handles concurrent requests efficiently without external dependencies.

What's the best way to read and write files quickly in Bun?

File I/O in Bun uses Bun.file for reads and Bun.write for writes, optimized for performance. Bun.file returns a file object with text(), json(), and arrayBuffer() methods; Bun.write accepts strings, buffers, or typed arrays and overwrites or appends to disk in a single operation.

How do I safely access environment variables in Bun?

Bun.env provides type-safe environment variable access at runtime. Reference variables as properties (Bun.env.VAR_NAME) rather than string keys to enable TypeScript checking and prevent undefined access errors in production workflows.

Can I run shell commands directly from Bun code?

Bun.$ executes shell commands inline within JavaScript. Pass command strings or template literals to Bun.$, capture stdout and stderr as promises, and integrate shell output into file-processing or API workflows without spawning separate processes.

Does Bun support WebSocket connections in HTTP servers?

Bun.serve includes built-in WebSocket support via the upgrade handler. Define an upgrade function in your server config to handle WebSocket connections, enabling real-time bidirectional communication alongside standard HTTP routes.