← All repositories
87,491 stars4,071 forksZigother0 views
bun.com

Bun

Features

  • High-Performance JavaScript RuntimesExecuting JavaScript and TypeScript applications with minimal latency and high throughput using a unified, optimized engine.
  • JavaScript Runtime EnvironmentsA high-performance execution engine that runs JavaScript and TypeScript code directly, providing native APIs for system-level tasks and web-standard compatibility.
  • JavaScript RuntimesBun executes JavaScript and TypeScript code using a high-performance runtime engine designed to minimize latency and maximize throughput for resource-intensive application workloads.
  • Package ManagersInstalling, auditing, and managing project packages with high-speed resolution and consistent versioning across complex development workspaces.
  • Dependency InstallersBun installs external packages and manages project requirements using high-speed package management tools.
  • Source Code BundlersBun transpiles and combines JavaScript, TypeScript, and JSX files while applying tree-shaking and dead-code elimination to reduce final bundle size.
  • Node.js Compatibility LayersBun maintains compatibility with existing ecosystems by implementing standard APIs and module resolution patterns that ensure seamless migration and interoperability for legacy application codebases.
  • Request RoutersBun defines request routing and middleware chains to process incoming traffic and execute logic before reaching final handlers.
  • File System I/OBun performs high-performance read and write operations on the local file system using native APIs optimized for speed and efficiency.
  • High-Performance Server RuntimesA specialized environment for building scalable network applications, featuring native HTTP handling, WebSocket support, and integrated database connectivity.
  • JavaScriptCore-Based RuntimesExecutes JavaScript and TypeScript code using a high-performance engine optimized for low-latency startup and efficient memory management.
  • Native Core ImplementationsImplements core system primitives and high-performance I/O using a memory-safe systems language to bypass traditional runtime bottlenecks.
  • Incremental BundlersUtilizes a high-performance native bundler that monitors file changes to perform rapid, incremental rebuilds during development cycles.
  • HTTP ServersBun initializes and runs high-performance web servers to handle incoming requests and manage network traffic efficiently.
  • All-in-One ToolchainsA unified development suite that integrates package management, test running, and build-time bundling into a single, high-speed command-line interface.
  • HTTP Response HandlingBun transforms response bodies and headers while maintaining streaming capabilities and automatic content encoding for efficient data delivery.
  • Socket ManagementBun handles low-level networking tasks including socket communication and protocol management to build high-performance distributed systems.
  • API Route DefinitionsBun maps HTTP methods and URL patterns to request handlers to process incoming traffic and return structured data within a unified server environment.
  • Embedded Database RuntimesBun initializes and manages local relational databases to store and query structured data with high performance and reliability.
  • Package PublishingBun uploads and distributes project packages to registries to share code and manage versioned releases.
  • Project Lockfile ManagementBun maintains consistent dependency versions across environments by generating and updating lockfiles that record exact package resolutions.
  • Hot Module ReplacementBun defines module boundaries that allow code to be re-evaluated or patched in real-time without requiring a full page reload during development.
  • Production Asset BuildersBun generates optimized production assets from entry points using minification and file watching to ensure high-performance delivery and deployment readiness.
  • Build-Time MacrosEvaluates code during the bundling process to perform static analysis, fetch data, or embed computed values directly into the output.
  • Bundler PluginsBun customizes the build pipeline using a plugin architecture that intercepts lifecycle hooks to modify resolution, loading, and transformation logic.
  • Native Bundlers and TranspilersA build-time engine that transforms, minifies, and packages source code into optimized assets or standalone executables with support for plugin-based extensions.
  • Unified Module ResolversProvides a single resolution strategy that maintains compatibility across CommonJS and ESM ecosystems within a unified execution environment.
  • Standalone Binary GeneratorsPackaging applications into standalone, dependency-free executables that run natively across multiple operating systems and architectures.
  • WebSocket ServersBun manages real-time, bidirectional communication channels within web servers to enable interactive and event-driven applications.
  • Foreign Function InterfacesA low-level bridge that enables direct execution of native C and C++ libraries, allowing seamless integration of high-performance binary code.
  • Native Library IntegrationsBun executes functions from external native libraries using low-level bindings to leverage existing C or C++ codebases.
  • Cryptographic PrimitivesBun generates cryptographic signatures and non-cryptographic hashes to ensure data integrity and secure sensitive information within applications.
  • Snapshot TestingBun captures rendered data or component structures to compare against stored references, ensuring that future changes do not introduce unexpected regressions in the output.
  • Test Lifecycle HooksBun executes setup and teardown logic before or after individual tests and test suites to maintain consistent state and clean up resources between runs.
  • Dependency MockingBun replaces complex modules or network requests with controlled substitutes to isolate units of code and ensure predictable outcomes during the testing process.
  • Workspace ManagersBun manages dependencies across multiple related packages within a single repository by defining shared configurations and linking local modules.
  • CLI Build ExecutorsBun executes project builds using command-line tools that support bundling, minification, and configuration to streamline high-performance application delivery.
  • Automated Build PipelinesStreamlining the transformation, bundling, and minification of source code into production-ready assets with high-speed native tooling.
  • Process ManagementBun spawns and controls external processes to execute shell commands or manage background tasks with full input and output stream integration.
  • Native System IntegrationsInterfacing with low-level OS APIs, native C/C++ libraries, and local file systems to perform resource-intensive background tasks.
  • JavaScript MinificationBun reduces bundle size by stripping whitespace and optimizing identifiers during the build process to improve load times and performance.
  • File-System-Based RoutersMaps directory structures and file paths automatically to HTTP endpoints by resolving request patterns against the local disk layout.
  • Prepared Statement EnginesBun compiles SQL queries into efficient binary forms to enable performant execution of repeated database operations.
  • JavaScript and TypeScript DebuggingBun analyzes source code execution by mapping transpiled output back to original files using integrated source map support for accurate line-by-line debugging.
  • Runtime InspectorsBun connects external debugging tools to the runtime via a web-based inspector protocol to visualize execution state and interact with live code.
  • Build MacrosBun runs code during the build process to fetch data or embed static values, replacing macro calls with computed results in the final output.
  • Asset EmbeddingBun includes static data and binary resources directly within standalone executables to eliminate external dependencies and simplify distribution.
  • Cross-Compilation UtilitiesBun generates standalone binaries for multiple operating systems and architectures from a single build environment to simplify cross-platform deployment.
  • TLS ConfigurationsBun enables secure communication by configuring TLS certificates and encryption settings for web servers.
  • FFI Type DefinitionsBun maps JavaScript data types to native C types to ensure correct memory layout and data passing when calling external functions.
  • Server MetricsBun collects and exposes server performance data and observability metrics to track health and resource usage in production environments.
  • DOM Testing UtilitiesBun verifies user interface interactions and element states by simulating browser-like environments within the test suite to ensure correct rendering and behavior.
  • CSS TranspilersBun converts modern CSS features into backwards-compatible formats with automatic vendor prefixing to ensure consistent visual rendering across all target browser versions.
  • CSS Module BundlersBun aggregates CSS files with automatic class scoping to prevent global namespace collisions while supporting modular composition and direct component imports.
  • Static HTML ServingBun delivers static HTML files as dynamic routes by bundling associated scripts and styles automatically during the server-side request process.
  • Object Storage ClientsBun uploads files and data directly to object storage services using static methods for simplified cloud storage integration.
  • HTML Document TransformationBun parses and modifies HTML content using CSS selectors to dynamically update documents during request or response handling.
  • Atomic Transaction ExecutionBun groups multiple database operations into atomic transactions to ensure data consistency and integrity during complex updates.
  • Console UtilitiesBun extends standard console functionality with native APIs to improve debugging and logging capabilities in development.
  • Dependency AuditingBun scans installed packages for security vulnerabilities and dependency issues to maintain a secure and stable project environment.
  • Package Metadata QueryingBun retrieves information about installed packages and project dependencies to manage versions and configuration details effectively.
  • File WatchersBun monitors source files for modifications to trigger automatic incremental rebuilds, ensuring development environments stay synchronized with the latest code changes in real time.
  • Local Dependency LinkersBun connects local development packages to projects to facilitate testing and iterative development without publishing to registries.
  • Binary Buffer AccessesBun retrieves the underlying memory buffer of a typed array to perform low-level data manipulation or direct memory inspection.
  • In-Process Task SchedulersBun executes asynchronous callbacks on a recurring schedule within the current process lifecycle to handle background logic without external dependencies.
  • HTTP Cookie ManagementBun represents and manipulates HTTP cookies with structured access to names, values, and security attributes.
  • Blob ConstructorsBun creates a blob object from multiple data sources including strings and binary chunks to facilitate standardized web-based data handling.
  • Executable SigningBun applies system-level security signatures and entitlements to standalone binaries to satisfy operating system requirements and prevent execution warnings.
  • Cryptographic Hash ComputationsBun generates secure hashes for strings or binary data using standard cryptographic algorithms to ensure data integrity.
  • Full-Stack Web DevelopmentBuilding and deploying scalable server-side APIs and client-side interfaces within a single, integrated development environment.
  • Native Plugin DevelopmentBun creates high-performance native extensions using low-level modules to execute intensive logic in parallel threads and bypass single-threaded limitations.
  • Bytecode Cache GeneratorsBun creates cached bytecode files during the build process to eliminate runtime parsing overhead and accelerate application startup times for executables.
  • Server Pattern FrameworksBun implements scalable server-side architectures using centralized error handling, environment-based configuration, and reusable response utilities to maintain clean codebases.
  • DOM Event ListenersBun attaches event listeners to HTML elements matching specific CSS selectors to perform transformations or logic during document parsing.
  • CSS Asset BundlingBun resolves style imports and associates them with JavaScript entry points while applying content hashing to optimize asset loading and caching.
  • File System RoutingsBun maps incoming request paths to specific files on the disk to automate routing based on project structure.
  • Single Page Application RoutersBun configures fallback routing to serve a single HTML file for all paths, enabling client-side navigation within complex web applications.