Files
2nd/10_Wiki/Topic_Programming/Coding/Runtime_Bun_Deno_Comparison.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

4.2 KiB

id, title, category, status, source_trust_level, verification_status, created_at, updated_at, tags, tech_stack, applied_in, aliases
id title category status source_trust_level verification_status created_at updated_at tags tech_stack applied_in aliases
runtime-bun-deno-comparison Runtime 비교 — Bun / Deno / Node.js Coding draft B conceptual 2026-05-09 2026-05-09
runtime
bun
deno
node
vibe-coding
language applicable_to
TS
Backend
Bun
Deno
Node.js
runtime
npm vs jsr
bunx
deno deploy

Runtime 비교

Node 가 표준 — 모든 npm 호환. Bun = 빠른 빌드 + 호환, Deno = 보안 + 표준 web API + JSR 레지스트리. 프로덕션 = Node 디폴트, 새 프로젝트 = Bun 시도 가치.

📖 핵심 개념

  • Node: V8 + libuv. 가장 호환.
  • Bun: Zig + JSC. 빠른 install / test / bundler 내장.
  • Deno: V8 + Rust. 권한 모델 + Web 표준 + JSR.
  • 모두 TS native (Bun, Deno) 또는 tsx 필요 (Node).

💻 코드 패턴

Bun

# install
bun install
bun add zod
bun add -d typescript

# 실행
bun run src/index.ts
bun --watch src/index.ts

# test
bun test

# bundler
bun build src/index.ts --outdir dist --target node
// Bun.serve (built-in HTTP)
Bun.serve({
  port: 3000,
  fetch(req) {
    const url = new URL(req.url);
    if (url.pathname === '/health') return new Response('ok');
    return new Response('not found', { status: 404 });
  },
});

// SQLite native
import { Database } from 'bun:sqlite';
const db = new Database('app.db');
db.query('SELECT * FROM users WHERE id = ?').get(id);

Deno

# install (per import)
deno run --allow-net main.ts

# permission flags
deno run --allow-net --allow-read=./data --allow-env main.ts
deno run -A main.ts # all (개발용)

# tasks
deno task dev
// imports — URL 또는 JSR / npm
import { z } from 'npm:zod@3';
import { serve } from 'jsr:@std/http';
import _ from 'https://esm.sh/lodash@4';

// 권한 명시 API
const data = await Deno.readTextFile('./data.json'); // --allow-read

Deno.serve({ port: 3000 }, (req) => new Response('hi'));

Web 표준 (모두 공유)

// 표준 API — Node 18+, Bun, Deno 모두 동일
const r = await fetch('https://api.example.com');
const text = await r.text();

addEventListener('fetch', e => e.respondWith(handle(e.request)));

Node compat (Bun)

// 거의 모든 npm 호환
import express from 'express';        // OK
import { createServer } from 'http';  // OK
import { db } from 'pg';              // OK (native binding 일부 issue)

Deno + Node (compat)

import express from 'npm:express';
import process from 'node:process';

대부분 호환 — 일부 native module 제약.

Test (Bun)

import { test, expect } from 'bun:test';

test('add', () => {
  expect(1 + 1).toBe(2);
});

bun test 가 jest 비슷한 inline matcher.

Test (Deno)

import { assertEquals } from 'jsr:@std/assert';

Deno.test('add', () => {
  assertEquals(1 + 1, 2);
});

성능 (대략)

작업 Node Bun Deno
Install (typical project) 30s 3s 5s
Cold start 100ms 50ms 80ms
Hot HTTP req/s 50K 90K 60K
TS execute 별 도구 native native

Edge runtime (Cloudflare Workers / Vercel)

  • Subset of Web Standard APIs only.
  • Node 호환 = 일부.
  • Bun / Deno 의 Web API 와 호환성 좋음.

🤔 의사결정 기준

상황 추천
Production 안전 Node.js
빠른 dev cycle Bun
보안 / 권한 Deno
Edge runtime 호환 Web standard 위주 (Bun / Deno)
큰 npm 의존 Node 또는 Bun
Library publish Node target + dual ESM/CJS
Self-hosted Node + PM2 또는 Bun

안티패턴

  • Bun 에서 native module 가정: pg / sharp 일부 issue. 검증.
  • Deno 권한 -A 만 prod: 보안 모델 무의미.
  • Bun.serve API 가정 prod prod 가까움: 아직 일부 edge case.
  • Web 표준 API + Node 전용 API 혼용: 호환성 깨짐.
  • Bun 의 npm install 결과 Node 로 이동: bun lockfile 만 나옴. yarn.lock 도 사용.
  • Deno 의 https URL import + 안 cache: 매번 fetch.

🤖 LLM 활용 힌트

  • Production = Node.
  • Greenfield 빠른 = Bun.
  • Web 표준 / 보안 = Deno.
  • 모두 fetch / Response / URL standard 동일.

🔗 관련 문서