Open-Source Wikis

/

Bun

/

Systems

oven-sh/bun

Systems

Internal building blocks that aren't user-facing subcommands. Most apps reuse multiple systems on this list.

What's here

System Source root Page
Parser, lexer, printer, transpiler src/js_parser.zig, src/js_lexer.zig, src/js_printer.zig, src/transpiler.zig Parser & transpiler
Module resolver src/resolver/ Module resolution
HTTP client and server stack src/http/, src/bun.js/api/server.zig HTTP stack
Event loop src/bun.js/event_loop.zig Event loop
C++ JSC bindings src/bun.js/bindings/ C++ bindings
Built-in JS modules src/js/ Built-in JS modules
Code generation src/codegen/ Code generation
CSS parser src/css/ CSS parser
SQL clients src/sql/ SQL clients
File watcher and hot reload src/Watcher.zig, src/bun.js/hot_reloader.zig Watcher & hot reload
Crash handler src/crash_handler.zig Crash handler
Allocators and bun.sys src/allocators/, src/sys.zig, src/sys/ Allocators & sys
Other subsystems various Other subsystems

How they fit together

Most subcommands reach for the same handful of systems:

  • bun run, bun test, bun repl → Parser, Module resolver, JSC bindings, Event loop, Built-in JS modules
  • bun build → Parser, Module resolver, CSS parser, JSC bindings (only for plugins), Code generation (build time)
  • bun install, bunx, bun upgrade → HTTP stack, allocators, sys
  • bun.serve → HTTP stack, Event loop, JSC bindings
  • Bake → Watcher, Bundler, HTTP stack, Hot reload

The crash_handler is implicitly active for every command. The code-generation subsystem only runs at build time.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Systems – Bun wiki | Factory