GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ignore: add bun/file io skill just for our repo · zoe531/opencode@1bc919d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .opencode/skill
    • bun-file-io
      • SKILL.md
    • test-skill
      • SKILL.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.opencode/skill/bun-file-io/SKILL.md‎

Copy file name to clipboard
+39Lines changed: 39 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: bun-file-io
3+
description: Use this when you are working on file operations like reading, writing, scanning, or deleting files. It summarizes the preferred file APIs and patterns used in this repo. It also notes when to use filesystem helpers for directories.
4+
---
5+
6+
## Use this when
7+
8+
- Editing file I/O or scans in `packages/opencode`
9+
- Handling directory operations or external tools
10+
11+
## Bun file APIs (from Bun docs)
12+
13+
- `Bun.file(path)` is lazy; call `text`, `json`, `stream`, `arrayBuffer`, `bytes`, `exists` to read.
14+
- Metadata: `file.size`, `file.type`, `file.name`.
15+
- `Bun.write(dest, input)` writes strings, buffers, Blobs, Responses, or files.
16+
- `Bun.file(...).delete()` deletes a file.
17+
- `file.writer()` returns a FileSink for incremental writes.
18+
- `Bun.Glob` + `Array.fromAsync(glob.scan({ cwd, absolute, onlyFiles, dot }))` for scans.
19+
- Use `Bun.which` to find a binary, then `Bun.spawn` to run it.
20+
- `Bun.readableStreamToText/Bytes/JSON` for stream output.
21+
22+
## When to use node:fs
23+
24+
- Use `node:fs/promises` for directories (`mkdir`, `readdir`, recursive operations).
25+
26+
## Repo patterns
27+
28+
- Prefer Bun APIs over Node `fs` for file access.
29+
- Check `Bun.file(...).exists()` before reading.
30+
- For binary/large files use `arrayBuffer()` and MIME checks via `file.type`.
31+
- Use `Bun.Glob` + `Array.fromAsync` for scans.
32+
- Decode tool stderr with `Bun.readableStreamToText`.
33+
- For large writes, use `Bun.write(Bun.file(path), text)`.
34+
35+
## Quick checklist
36+
37+
- Use Bun APIs first.
38+
- Use `path.join`/`path.resolve` for paths.
39+
- Prefer promise `.catch(...)` over `try/catch` when possible.
Collapse file

‎.opencode/skill/test-skill/SKILL.md‎

Copy file name to clipboardExpand all lines: .opencode/skill/test-skill/SKILL.md
-6Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.