bun-runtime

TotalClaw 作者 totalclaw

Bun 运行时功能用于文件系统、进程和网络操作。当您需要执行 Bun 特定的操作(例如 Bun.file()、Bun.write() 或 Bun.glob() 来优化文件处理时,或者在使用 Bun 的本机进程/网络 API 时使用。由对 Bun 运行时功能、Bun 的文件操作或高性能 I/O 任务的请求触发。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~rabin-thami-bun-runtime
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~rabin-thami-bun-runtime/file -o rabin-thami-bun-runtime.md
## 概述(中文)

Bun 运行时功能用于文件系统、进程和网络操作。当您需要执行 Bun 特定的操作(例如 Bun.file()、Bun.write() 或 Bun.glob() 来优化文件处理时,或者在使用 Bun 的本机进程/网络 API 时使用。由对 Bun 运行时功能、Bun 的文件操作或高性能 I/O 任务的请求触发。

## 原文

# Bun Runtime

Native Bun runtime operations for filesystem, process, and network tasks.

## When to Use

Use this skill when:
- Working with Bun's native file APIs (`Bun.file()`, `Bun.write()`, `Bun.glob()`)
- Need optimized I/O operations in Bun environment
- Running Bun-specific process commands
- Making network requests with Bun's fetch

## Filesystem Operations

### Read File

```bash
scripts/bun-fs.sh read /path/to/file.txt
```

Returns JSON: `{"content": "file contents"}`

### Write File

```bash
scripts/bun-fs.sh write /path/to/file.txt "content here"
```

Creates parent directories automatically.
Returns JSON: `{"written": true, "path": "/path/to/file.txt"}`

### Glob Files

```bash
scripts/bun-glob.sh "/tmp/*.txt"
```

Returns JSON: `{"files": ["/tmp/file1.txt", "/tmp/file2.txt"], "count": 2}`

## Process Operations

### Execute Command

```bash
scripts/bun-process.sh "ls -la"
```

Runs shell command and returns output.

## Network Operations

### HTTP Request

```bash
scripts/bun-fetch.sh "https://api.example.com" "GET"
```

Makes HTTP request using Bun's native fetch.

## Notes

- All scripts use Bun's native APIs for better performance
- File operations automatically handle encoding
- Errors are returned with clear messages