← Back to list

typescript-inline-scripts
by jahands
My AI prompts
⭐ 19🍴 3📅 Jan 15, 2026
SKILL.md
name: typescript-inline-scripts description: Guide for running inline TypeScript scripts with Bun
TypeScript Inline Scripts with Bun
IMPORTANT
- ALWAYS assume Bun runtime with modern TypeScript features
- Imported npm packages will be automatically installed by Bun
- ALWAYS prefer Bun APIs where possible
Example
bun run --install=fallback - < <(cat <<'EOF'
import { z } from 'zod'
console.log(z.coerce.number().parse('5'))
EOF
)
Bun APIs Reference
Core Runtime APIs
Bun.spawn()- Process spawning and managementBun.file()- File system operations and readingBun.write()- File writing operationsfetch()- HTTP requests (Web API standard)Bun.preconnect()- URL preconnection for performance
File System
Bun.file(path)- Create file handle for reading/writingawait Bun.file(path).text()- Read file as textawait Bun.file(path).json()- Read file as JSONawait Bun.file(path).arrayBuffer()- Read file as ArrayBufferawait Bun.write(path, data)- Write data to file
Shell Commands
import { $ } from "bun"
await $`command` // Execute shell commands with template literals
const result = await $`ls -la` // Capture command output
Compression
Bun.gzipSync()- Synchronous gzip compressionBun.gunzipSync()- Synchronous gzip decompressionBun.inflateSync()- Synchronous deflate decompression
SQLite
import { Database } from "bun:sqlite"
// Database operations and SQL execution
FFI (Foreign Function Interface)
import { dlopen, CString } from "bun:ffi"
// Native library interaction
Utilities
Bun.escapeHTML()- HTML escapingBun.hash()- Hashing functionsBun.password.hash()- Password hashingBun.password.verify()- Password verification
Node.js Compatibility
- Full Node.js API support via
node:imports import { createRequire } from 'node:module'- All standard Node.js modules available
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon