jpskill.com
🛠️ 開発・MCP コミュニティ

bun

BunをJavaScript/TypeScriptの実行環境、パッケージ管理、バンドル、テストに活用し、HTTPサーバー構築、Node.jsからの移行などを効率的に進めるための支援をするSkill。

📜 元の英語説明(参考)

Assists with using Bun as an all-in-one JavaScript/TypeScript runtime, package manager, bundler, and test runner. Use when building HTTP servers, managing packages, running tests, or migrating from Node.js. Trigger words: bun, bun serve, bun install, bun test, bun build, javascript runtime, bun runtime.

🇯🇵 日本人クリエイター向け解説

一言でいうと

BunをJavaScript/TypeScriptの実行環境、パッケージ管理、バンドル、テストに活用し、HTTPサーバー構築、Node.jsからの移行などを効率的に進めるための支援をするSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o bun.zip https://jpskill.com/download/14710.zip && unzip -o bun.zip && rm bun.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14710.zip -OutFile "$d\bun.zip"; Expand-Archive "$d\bun.zip" -DestinationPath $d -Force; ri "$d\bun.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して bun.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → bun フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Bun

概要

Bun は、Node.js、npm、webpack、Jest を単一のバイナリで置き換える、オールインワンの JavaScript/TypeScript ランタイムです。ネイティブな TypeScript サポート、高性能な HTTP サーバー (Bun.serve())、高速なパッケージマネージャー、バンドラー、そして Jest と互換性のあるテストランナーを提供し、劇的に高速なパフォーマンスを実現します。

指示

  • HTTP サーバーを作成する際は、WebSocket サポート、TLS、ストリーミングレスポンスが組み込まれた 10 万 req/s 以上を処理する Bun.serve() を使用してください。
  • パッケージを管理する際は、bun install (npm より 10〜30 倍高速)、bun addbun remove を使用し、可読性の高い git diff のために bun.lock (テキスト形式) を推奨します。
  • バンドルする際は、適切なターゲット ("browser""bun""node") を指定して Bun.build() を使用し、splitting: true でコード分割を有効にし、ツリーシェイキングを設定します。
  • テストを書く際は、Jest と互換性のある API (describeitexpect)、スナップショットテスト、mock.module() によるモック、そしてコードカバレッジのための --coverage を使用して bun test を使用します。
  • ファイル I/O を行う際は、Node.js の fs よりも大幅に高速なファイル操作のために Bun.file()Bun.write() を優先し、パターンマッチングには Bun.Glob を使用します。
  • 認証を処理する際は、npm パッケージの代わりに bcrypt/argon2 用の Bun.password.hash()Bun.password.verify() を使用します。
  • Node.js から移行する際は、スクリプト内の nodebun に置き換え、package.json は変更せずに維持し、ほとんどの npm パッケージは変更なしで動作することに注意してください。埋め込みデータベースには、SQLite npm パッケージの代わりに bun:sqlite を使用します。

例 1: 高性能な API サーバーの構築

ユーザーリクエスト: "Bun の組み込み HTTP サーバーを使用して REST API を作成する"

アクション:

  1. Bun.serve() とルートハンドラーでサーバーを作成する
  2. request.json() で JSON ボディを解析し、Response オブジェクトを返す
  3. リアルタイム機能のために WebSocket アップグレードを追加する
  4. 認証には Bun.password を、データストレージには bun:sqlite を使用する

出力: 外部依存関係なしで、Bun の組み込み機能のみを使用した高速な API サーバー。

例 2: Node.js プロジェクトを Bun に移行する

ユーザーリクエスト: "Express プロジェクトを Node.js から Bun に切り替える"

アクション:

  1. CI とローカルセットアップで npm installbun install に置き換える
  2. package.json スクリプトを更新して、node の代わりに bun run を使用する
  3. dotenv を Bun の組み込み .env ローディングに置き換える
  4. テストランナーを Jest から同じテストファイルを使用した bun test に切り替える

出力: より高速なインストール、起動、およびテスト実行を備えた Bun 駆動のプロジェクト。

ガイドライン

  • 新しい HTTP サーバーには Bun.serve() を使用してください。Bun 上では Express よりも大幅に高速です。
  • ファイル操作には、Node.js の fs よりも Bun.file()Bun.write() を優先してください。
  • ローカルデータには、SQLite npm パッケージを追加する代わりに bun:sqlite を使用してください。
  • 認証には、ネイティブ依存関係をゼロにするために、bcrypt/argon2 npm パッケージの代わりに Bun.password を使用してください。
  • 可読性の高い diff のために、bun.lock (テキスト形式) を git に保持してください。
  • 大幅に高速な実行で同じ API を実現するために、Jest の代わりに bun test でテストしてください。
  • ブラウザをターゲットにする場合は、target: "browser" を指定して Bun.build() を使用してください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Bun

Overview

Bun is an all-in-one JavaScript/TypeScript runtime that replaces Node.js, npm, webpack, and Jest with a single binary. It provides native TypeScript support, a high-performance HTTP server (Bun.serve()), a fast package manager, a bundler, and a Jest-compatible test runner with dramatically faster performance.

Instructions

  • When creating HTTP servers, use Bun.serve() which handles 100K+ req/s with built-in WebSocket support, TLS, and streaming responses.
  • When managing packages, use bun install (10-30x faster than npm), bun add, bun remove, and prefer bun.lock (text format) for readable git diffs.
  • When bundling, use Bun.build() with appropriate target ("browser", "bun", "node"), enable code splitting with splitting: true, and configure tree shaking.
  • When writing tests, use bun test with Jest-compatible API (describe, it, expect), snapshot testing, mocking with mock.module(), and --coverage for code coverage.
  • When doing file I/O, prefer Bun.file() and Bun.write() over Node.js fs for significantly faster file operations, and use Bun.Glob for pattern matching.
  • When handling authentication, use Bun.password.hash() and Bun.password.verify() for bcrypt/argon2 instead of npm packages.
  • When migrating from Node.js, replace node with bun in scripts, keep package.json unchanged, and note that most npm packages work without modifications. Use bun:sqlite for embedded databases instead of SQLite npm packages.

Examples

Example 1: Build a high-performance API server

User request: "Create a REST API using Bun's built-in HTTP server"

Actions:

  1. Create server with Bun.serve() and route handler
  2. Parse JSON bodies with request.json() and return Response objects
  3. Add WebSocket upgrade for real-time features
  4. Use Bun.password for auth and bun:sqlite for data storage

Output: A fast API server using only Bun built-ins with no external dependencies.

Example 2: Migrate a Node.js project to Bun

User request: "Switch my Express project from Node.js to Bun"

Actions:

  1. Replace npm install with bun install in CI and local setup
  2. Update package.json scripts to use bun run instead of node
  3. Replace dotenv with Bun's built-in .env loading
  4. Switch test runner from Jest to bun test with same test files

Output: A Bun-powered project with faster installs, startup, and test execution.

Guidelines

  • Use Bun.serve() for new HTTP servers; it is significantly faster than Express on Bun.
  • Prefer Bun.file() and Bun.write() over Node.js fs for file operations.
  • Use bun:sqlite for local data instead of adding SQLite npm packages.
  • Use Bun.password for auth instead of bcrypt/argon2 npm packages for zero native dependencies.
  • Keep bun.lock (text format) in git for readable diffs.
  • Test with bun test instead of Jest for the same API with dramatically faster execution.
  • When targeting browsers, use Bun.build() with target: "browser".