File SystemRuntime & Debugging
Inspect memory usage using V8 heap snapshots
Bun implements V8's heap snapshot API. Use it to capture the heap at runtime and debug memory leaks in your JavaScript/TypeScript application.
Debugging Bun with the web debugger
Bun speaks the WebKit Inspector Protocol . To enable debugging when running code with Bun, use the --inspect flag. Consider the following web server.
Build-time constants with --define
Pass --define to bun build or bun build --compile to inject build-time constants into your application. Use it to embed metadata like build versions,