1import{f,L,w,S,a,I,r,s,i,o,e,t,x,l,n,c,we,_,v,R,M,G,z,y,Ne,E}from"./chunk-e7xk0yn7.js";import{U,te,ne,se}from"./chunk-g5z1a62h.js";import{N,k}from"./chunk-as3fpxpb.js";import{F}from"./chunk-sk34g2c4.js";var Pe={};f(Pe,{default:()=>nt,layout:()=>kt});var et=(d)=>d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1000?`${Math.round(d/1000)}k`:String(d),tt=["express-https","websocket-chat","install-nextjs"].map((d)=>{let m=U.panels.find((p)=>p.id===d);if(!m)throw Error(`Efficiency: bench panel "${d}" missing from runtime-bench.json`);let u=m.rows.filter((p)=>p.highlight||!p.label.toLowerCase().startsWith("bun")),g=m.rows.find((p)=>p.highlight),C=m.dir==="lower"?"peak memory, warm cache":`peak memory while handling ${et(g.value)} ${m.unit}`;return{title:m.title,sub:C,href:m.href,rows:u.map((p)=>({name:p.highlight?p.label.startsWith("bun")?"bun":"Bun":p.label,mb:p.memoryMB,bun:!!p.highlight})).sort((p,b)=>p.mb-b.mb)}}),st=(d)=>d>=1000?`${(d/1024).toFixed(1)} GB`:`${d} MB`;function at({p:d}){let m=Math.max(...d.rows.map((p)=>p.mb)),u=(p)=>Math.max(Math.sqrt(p)/Math.sqrt(m)*100,3),g=d.rows.find((p)=>p.bun).mb,C=Math.max(...d.rows.filter((p)=>!p.bun).map((p)=>p.mb));return t("figure",{className:"flex flex-col bg-surface p-6",children:[t("figcaption",{children:[e("div",{className:"text-[15px] font-semibold leading-tight text-fg",children:d.title}),e("div",{className:"mt-1 text-[12.5px] text-fg-faint",children:d.sub})]}),e("div",{className:"mt-5 flex flex-1 flex-col gap-2.5",children:d.rows.map((p)=>t("div",{className:"grid grid-cols-[5.5rem_1fr_3.75rem] items-center gap-3",children:[e("span",{className:n("truncate text-[13px]",p.bun?"font-semibold text-fg":"text-fg-muted"),children:p.name}),e("span",{className:"relative h-3 rounded-full bg-subtle",children:e("span",{className:n("absolute inset-y-0 left-0 ",p.bun?"bg-accent":"bg-bar"),style:{width:`${u(p.mb)}%`}})}),e("span",{className:n("mono text-right text-[12px] tabular-nums",p.bun?"font-semibold text-fg":"text-fg-muted"),children:st(p.mb)})]},p.name))}),t("div",{className:"mono mt-5 flex items-center justify-between border-t border-line pt-3 text-[11px] text-fg-faint",children:[t("span",{children:[t("span",{className:"text-accent-strong",children:[Math.round(C/g),"à less"]})," than the hungriest · â scale"]}),e("a",{href:d.href,target:"_blank",rel:"noopener",className:"hover:text-fg",children:"reproduce â"})]})]})}function Me(){return e("section",{className:"border-t border-line py-16 md:py-28","aria-labelledby":"eff-heading",children:t(c,{children:[t(x,{className:"grid items-end gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[e("div",{children:t("h2",{id:"eff-heading",className:"display mt-4 text-balance text-[clamp(2.6rem,6vw,4.75rem)] text-fg",children:["Everything built in. ",e("span",{className:"text-fg-faint",children:"Nothing weighing it down."})]})}),e("p",{className:"max-w-[52ch] text-[1.02rem] leading-relaxed text-fg-muted lg:pb-2",children:"All-in-one usually means heavier. Bun goes the other way: the same runs as the benchmarks above, measured by peak resident memory, come in under Node.js and Deno while doing more work per second. One binary, more throughput, less RAM."})]}),e(x,{className:"ruled mt-12 grid md:grid-cols-3",children:tt.map((d)=>e(at,{p:d},d.title))}),t("p",{className:"mt-4 text-[12px] text-fg-faint",children:[U.machine," · ",U.runs," · full methodology in each benchmark's README."]})]})})}i();i();var rt={pink:{fill:"#f472b6",text:"#111"},yellow:{fill:"#fcd34d",text:"#111"},blue:{fill:"#7cc4ff",text:"#111"},green:{fill:"#4ade80",text:"#111"},cream:{fill:"#fbf0df",text:"#111"}};function je({lines:d,color:m="pink",size:u=84,spin:g="100s",className:C=""}){let p=rt[m];return e("span",{className:`stamp inline-block rotate-6 select-none ${C}`,style:{width:u,height:u},"aria-hidden":!0,children:t("svg",{viewBox:"0 0 100 100",width:u,height:u,className:"drop-shadow-[0_2px_2px_rgba(0,0,0,0.25)]",children:[e("g",{className:"origin-[50px_50px] animate-[spin-starburst_var(--spin)_linear_infinite]",style:{["--spin"]:g},children:e("path",{d:"M 50,0 L 56.83,15.67 L 69.13,3.81 L 69.44,20.9 L 85.36,14.64 L 79.1,30.56 L 96.19,30.87
1L 84.33,43.17 L 100,50 L 84.33,56.83 L 96.19,69.13 L 79.1,69.44 L 85.36,85.36 L 69.44,79.1 L 69.13,96.19 L 56.83,84.33 L 50,100 L 43.17,84.33 L 30.87,96.19 L 30.56,79.1 L 14.64,85.36 L 20.9,69.44 L 3.81,69.13 L 15.67,56.83 L 0,50 L 15.67,43.17 L 3.81,30.87 L 20.9,30.56 L 14.64,14.64 L 30.56,20.9 L 30.87,3.81 L 43.17,15.67 Z",fill:p.fill,stroke:"#111",strokeWidth:"2.5",strokeLinejoin:"round"})}),t("text",{x:"50",y:d[1]?46:54,textAnchor:"middle",fill:p.text,fontSize:"11",fontWeight:"800",fontFamily:"var(--font-sans)",letterSpacing:"0.02em",style:{textTransform:"uppercase"},children:[e("tspan",{x:"50",children:d[0]}),d[1]?e("tspan",{x:"50",dy:"1.15em",fontSize:"14",children:d[1]}):null]})]})})}i();var Ee=L(null),ot=()=>S(Ee),ge=(d)=>{if(!isFinite(d))return"0:00";let m=Math.floor(d/60),u=Math.floor(d%60);return`${m}:${u.toString().padStart(2,"0")}`};function re({d,className:m}){return e("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:n("h-5 w-5",m),"aria-hidden":!0,children:e("path",{d})})}var xe="M8 5.14v13.72c0 .8.87 1.3 1.55.9l10.4-6.86a1.08 1.08 0 000-1.8L9.55 4.24C8.87 3.84 8 4.34 8 5.14z",it="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z",lt="M6 5h2v14H6zM20 6.2v11.6c0 .8-.9 1.3-1.6.8L10 12l8.4-6.6c.7-.5 1.6 0 1.6.8z",ct="M16 5h2v14h-2zM4 6.2v11.6c0 .8.9 1.3 1.6.8L14 12 5.6 5.4C4.9 4.9 4 5.4 4 6.2z",dt="M4 9v6h4l5 4V5L8 9H4zm12.5 3a4.5 4.5 0 00-2.5-4v8a4.5 4.5 0 002.5-4z",mt="M4 9v6h4l5 4V5L8 9H4zm14.6 3l2.4-2.4-1.4-1.4-2.4 2.4-2.4-2.4-1.4 1.4 2.4 2.4-2.4 2.4 1.4 1.4 2.4-2.4 2.4 2.4 1.4-1.4L18.6 12z",pt="M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z",ut="M6.4 5L5 6.4l5.6 5.6L5 17.6 6.4 19l5.6-5.6 5.6 5.6 1.4-1.4-5.6-5.6L19 6.4 17.6 5 12 10.6 6.4 5z";function gt({clips:d,index:m,setIndex:u,onClose:g}){let C=d[m],p=r(null),b=r(null),[P,T]=s(!1),[j,X]=s(0),[H,J]=s(0),[Z,Y]=s(0),[ee,V]=s(!1),[K,D]=s(!0),[O,Q]=s(!0),oe=r();a(()=>{let B=p.current;if(!B)return;X(0),J(0),Y(0),B.load(),B.play().catch(()=>T(!1))},[C.id]),a(()=>{let B=p.current;if(!B)return;for(let A of Array.from(B.textTracks))A.mode=K?"showing":"hidden"},[K,C.id]);let de=w(()=>{let B=p.current;if(!B)return;if(B.paused)B.play().catch(()=>{});else B.pause()},[]),pe=(B)=>{let A=p.current;if(A)A.currentTime=Math.max(0,Math.min(A.duration||0,A.currentTime+B))},Ce=()=>{let B=b.current;if(!B)return;if(document.fullscreenElement)document.exitFullscreen();else B.requestFullscreen?.()};a(()=>{let B=(A)=>{if(A.key==="Escape")return g();if(A.key===" "||A.key.toLowerCase()==="k")A.preventDefault(),de();else if(A.key==="ArrowRight")pe(5);else if(A.key==="ArrowLeft")pe(-5);else if(A.key.toLowerCase()==="m")V((ae)=>!ae);else if(A.key.toLowerCase()==="c")D((ae)=>!ae);else if(A.key.toLowerCase()==="f")Ce();else if(A.key==="."||A.key===">")u((m+1)%d.length);else if(A.key===","||A.key==="<")u((m-1+d.length)%d.length);else return;ue()};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[m,d.length,g,de]);let ue=()=>{Q(!0),clearTimeout(oe.current),oe.current=setTimeout(()=>Q(!1),2200)};a(()=>()=>clearTimeout(oe.current),[]);let be=O||!P,Ze=(B)=>{let A=p.current;if(!A||!H)return;let ae=B.currentTarget,Le=(he)=>{let Te=ae.getBoundingClientRect();A.currentTime=Math.max(0,Math.min(1,(he-Te.left)/Te.width))*H};Le(B.clientX),ae.setPointerCapture(B.pointerId);let Be=(he)=>Le(he.clientX),Re=()=>{ae.removeEventListener("pointermove",Be),ae.removeEventListener("pointerup",Re)};ae.addEventListener("pointermove",Be),ae.addEventListener("pointerup",Re)},ie="inline-flex h-10 w-10 items-center justify-center rounded-full text-white/85 transition-colors hover:bg-white/10 hover:text-white focus-visible:bg-white/10";return t("div",{className:"dark fixed inset-0 z-[100] flex flex-col bg-black/85 text-white animate-fade-in [animation-duration:.2s]",role:"dialog","aria-modal":"true","aria-label":`${C.person}: ${C.title}`,children:[t("div",{className:"flex items-center justify-between gap-4 px-4 py-3 md:px-6",children:[t("div",{className:"min-w-0",children:[e("p",{className:"truncate text-[15px] font-semibold",children:C.person}),e("p",{className:"truncate text-[12.5px] text-white/60",children:C.role})]}),t("div",{className:"flex items-center gap-1",children:[t("span",{className:"mono mr-2 hidden text-[11px] text-white/40 sm:inline",children:[m+1," / ",d.length]}),e("button",{type:"button",className:ie,"aria-label":"Previous video",onClick:()=>u((m-1+d.length)%d.length),children:e(re,{d:lt})}),e("button",{type:"button",className:ie,"aria-label":"Next video",onClick:()=>u((m+1)%d.length),children:e(re,{d:ct})}),e("button",{type:"button",className:n(ie,"ml-1 bg-white/10"),"aria-label":"Close",onClick:g,children:e(re,{d:ut})})]})]}),e("div",{className:"flex min-h-0 flex-1 items-center justify-center px-2 pb-4 md:px-6 md:pb-6",onClick:(B)=>B.target===B.currentTarget&&g(),children:t("div",{ref:b,className:"group/stage relative aspect-video max-h-full w-full max-w-6xl overflow-hidden rounded-xl bg-black shadow-2xl ring-1 ring-white/10 md:rounded-2xl",onMouseMove:ue,onTouchStart:ue,children:[t("video",{ref:p,className:n("lb-video h-full w-full cursor-pointer object-contain",C.id==="leerob-nextjs-video"&&"scale-[1.018]",!be&&"cursor-none"),"data-chrome":be?"":void 0,playsInl
1ine:!0,poster:C.poster,muted:ee,preload:"metadata",onClick:de,onPlay:()=>{T(!0),ue()},onPause:()=>T(!1),onEnded:()=>u((m+1)%d.length),onTimeUpdate:(B)=>X(B.currentTarget.currentTime),onLoadedMetadata:(B)=>J(B.currentTarget.duration),onProgress:(B)=>{let A=B.currentTarget.buffered;if(A.length)Y(A.end(A.length-1))},children:[C.sources.map((B)=>e("source",{src:B.src,type:B.type},B.src)),C.track?e("track",{kind:"captions",src:C.track,srcLang:"en",label:"English",default:!0}):null]},C.id),!P?e("button",{type:"button",onClick:de,"aria-label":"Play",className:"absolute inset-0 flex items-center justify-center",children:e("span",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-white text-black transition-transform duration-200 hover:scale-105",children:e(re,{d:xe,className:"h-8 w-8"})})}):null,t("div",{className:n("absolute inset-x-0 bottom-0 bg-black/70 px-3 pb-3 pt-3 transition-opacity duration-300 md:px-5 md:pb-4",be?"opacity-100":"pointer-events-none opacity-0"),children:[t("div",{role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.round(H),"aria-valuenow":Math.round(j),"aria-valuetext":`${ge(j)} of ${ge(H)}`,tabIndex:0,onPointerDown:Ze,onKeyDown:(B)=>{if(B.key==="ArrowRight")pe(5);else if(B.key==="ArrowLeft")pe(-5)},className:"group/bar relative h-4 cursor-pointer touch-none",children:[t("div",{className:"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-white/20 transition-[height] group-hover/bar:h-1.5",children:[e("div",{className:"absolute inset-y-0 left-0 rounded-full bg-white/25",style:{width:`${H?Z/H*100:0}%`}}),e("div",{className:"absolute inset-y-0 left-0 rounded-full bg-accent",style:{width:`${H?j/H*100:0}%`}})]}),e("div",{className:"absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white opacity-0 shadow transition-opacity group-hover/bar:opacity-100",style:{left:`${H?j/H*100:0}%`}})]}),t("div",{className:"mt-1.5 flex items-center gap-1",children:[e("button",{type:"button",className:ie,onClick:de,"aria-label":P?"Pause":"Play",children:e(re,{d:P?it:xe})}),e("button",{type:"button",className:ie,onClick:()=>V((B)=>!B),"aria-label":ee?"Unmute":"Mute",children:e(re,{d:ee?mt:dt})}),t("span",{className:"mono ml-1 text-[12px] tabular-nums text-white/70",children:[ge(j)," ",t("span",{className:"text-white/35",children:["/ ",ge(H)]})]}),e("span",{className:"flex-1"}),C.track?e("button",{type:"button",onClick:()=>D((B)=>!B),"aria-label":"Captions","aria-pressed":K,className:n(ie,"mono w-auto px-2.5 text-[11px] font-semibold",K?"text-white":"text-white/50"),children:e("span",{className:n("rounded border px-1.5 py-0.5",K?"border-white bg-white text-black":"border-white/50"),children:"CC"})}):null,e("button",{type:"button",className:ie,onClick:Ce,"aria-label":"Fullscreen",children:e(re,{d:pt})})]})]})]})}),e("div",{className:"hidden justify-center gap-2 px-6 pb-5 sm:flex",children:d.map((B,A)=>e("button",{type:"button",onClick:()=>u(A),"aria-label":`${B.person}: ${B.title}`,"aria-current":A===m,className:n("relative h-14 w-24 overflow-hidden rounded-lg ring-1 transition-[opacity,box-shadow]",A===m?"opacity-100 ring-2 ring-accent":"opacity-50 ring-white/15 hover:opacity-90"),children:e("img",{src:B.thumb,alt:"",className:"h-full w-full object-cover"})},B.id))})]})}function Ae({clips:d,children:m}){let[u,g]=s(null),C=r(null),p=w((P)=>{C.current=document.activeElement,g(P)},[]),b=w(()=>{if(g(null),document.fullscreenElement)document.exitFullscreen().catch(()=>{});C.current?.focus()},[]);return a(()=>(document.documentElement.classList.toggle("overflow-hidden",u!==null),()=>document.documentElement.classList.remove("overflow-hidden")),[u]),t(Ee.Provider,{value:{open:p},children:[m,u!==null?e(gt,{clips:d,index:u,setIndex:g,onClose:b}):null]})}function ve({clip:d,index:m,className:u,overlay:g=!0,size:C="md"}){let p=ot();return t("button",{type:"button",onClick:()=>p?.open(m),"aria-label":`Play video: ${d.person}, ${d.role} â ${d.title}`,className:n("group/poster relative isolate block w-full overflow-hidden bg-black text-left",u),children:[e("img",{src:d.thumb,alt:"",className:"h-full w-full object-cover",loading:"lazy",decoding:"async"}),e("span",{className:"absolute inset-x-0 bottom-0 h-20 bg-black/55","aria-hidden":!0}),e("span",{className:"absolute inset-0 flex items-center justify-center","aria-hidden":!0,
1children:e("span",{className:n("flex items-center justify-center rounded-full bg-white/95 text-black ring-1 ring-black/10 transition-transform duration-300 group-hover/poster:scale-110",C==="lg"?"h-20 w-20":"h-14 w-14"),children:e(re,{d:xe,className:C==="lg"?"h-8 w-8":"h-6 w-6"})})}),g?t("span",{className:"absolute inset-x-0 bottom-0 px-5 pb-4 text-white",children:[e("span",{className:"block text-[15px] font-semibold leading-tight",children:d.person}),e("span",{className:"block text-[12.5px] text-white/75",children:d.role})]}):null]})}var ft=[{name:"Anthropic",src:"/logos/anthropic.png",w:111,h:13},{name:"Cloudflare",src:"/logos/cloudflare.svg",w:139,h:14},{name:"Vercel",src:"/logos/vercel.svg",w:67,h:15},{name:"Expo",src:"/logos/expo.svg",w:61,h:17,dy:3},{name:"Cursor",src:"/logos/cursor.svg",w:77,h:14},{name:"Midjourney",src:"/logos/midjourney.png",w:91,h:17,dy:3},{name:"X",src:"/logos/x.png",w:15,h:15,dy:1},{name:"Lovable",src:"/logos/lovable.svg",w:84,h:15},{name:"Tailwind CSS",src:"/logos/tailwind.png",w:128,h:15},{name:"Replit",src:"/logos/replit-wordmark.svg",w:55,h:16,dy:2},{name:"CodeRabbit",src:"/logos/coderabbit.svg",w:103,h:15},{name:"Prisma",src:"/logos/prisma.svg",w:59,h:19,dy:1}];function bt(){return t("div",{className:"flex flex-col gap-4 py-6",children:[e("p",{className:"label shrink-0",children:"Used by"}),e("ul",{className:"m-0 flex list-none flex-wrap items-end gap-x-8 gap-y-5 p-0 text-fg-muted md:gap-x-9 xl:flex-nowrap xl:justify-between xl:gap-x-3",children:ft.map((d)=>e("li",{className:"m-0 p-0",children:e("span",{role:"img","aria-label":d.name,className:"logo-mask block",style:{["--logo"]:`url(${d.src})`,width:d.w,height:d.h,marginBottom:d.dy?-d.dy:void 0}})},d.name))})]})}function He({releaseHref:d}){return t("section",{className:"register relative overflow-hidden",children:[t(c,{className:"grid gap-12 pb-12 pt-10 md:pt-14 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.08fr)] lg:items-start lg:gap-16 lg:pb-16 [&>*]:min-w-0",children:[t("div",{children:[t(l,{href:d,className:"group/pill label inline-flex items-center gap-2.5 text-fg hover:text-accent",children:[e("span",{className:"bg-accent px-1.5 py-[3px] text-[10px] leading-none text-white",children:"NEW"}),t("span",{children:["Bun v",E," released"]}),e("span",{"aria-hidden":!0,className:"transition-transform duration-150 group-hover/pill:translate-x-0.5",children:"â"})]}),t("h1",{className:"display mt-6 text-[clamp(2.5rem,5vw,4.25rem)] text-fg",children:["Bun is a ",e("span",{className:"zoomy text-accent",children:"fast"})," JavaScript runtime",e("span",{className:"text-fg-faint",children:" & "}),"toolkit. All in one."]}),t("p",{className:"text-pretty mt-6 max-w-[42ch] text-[1.06rem] leading-[1.55] text-fg-muted md:text-[1.12rem]",children:["Runtime, package manager, test runner and bundler in a single binary. Use"," ",e(l,{href:"/package-manager",className:"text-fg underline underline-offset-4 hover:bg-fg hover:text-canvas hover:decoration-transparent",children:"bun install"})," ","or ",e(l,{href:"/docs/cli/test",className:"text-fg underline underline-offset-4 hover:bg-fg hover:text-canvas hover:decoration-transparent",children:"bun test"})," in an existing Node.js project, or run the whole thing on Bun."]}),t("p",{className:"mt-10 text-[14px] font-semibold text-fg",children:["Install Bun v",E]}),e(ne,{className:"mt-2.5"}),e("div",{className:"mt-5",children:e(R,{href:"/docs/quickstart",className:"text-[15px]",children:"Then follow the quickstart"})})]}),e("div",{children:e(te,{variant:"board",className:"lg:mt-16"})})]}),e("div",{className:"border-y border-line",children:e(c,{children:e(bt,{})})})]})}var ht=[{title:"Runtime",command:"bun run index.tsx",replaces:"Node.js",stamp:{lines:["replaces","Node.js"],color:"pink",spin:"93s"},body:"Runs JavaScript & TypeScript on JavaScriptCore. Node.js APIs, node_modules and your framework work as-is.",href:"/docs/cli/run",features:[["Node.js API compatibility","/docs/runtime/nodejs-apis"],["TypeScript & JSX, zero config","/docs/runtime/typescript"],["Built-in Postgres, Redis, S3, SQLite","/docs/api/sql"],["Watch & hot reload","/docs/runtime/hot"]],glyph:e("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",className:"h-7 w-7",children:e("path",{d:"M6 9l7 7-7 7M15 24h11"})})},{title:"Package manager",command:"bun install",replaces:"npm · yarn · pnpm",stamp:{lines:["replaces","npm"],color:"blue",spin:"107s"},body:"npm-compatible, up to 30à faster. Workspaces, catalogs, overrides, patches and a lockfile you can read.",href:"/package-manager",features:[["Reads package.json & migrates your lockfile","/docs/pm/lockfile"],["Workspaces, catalogs, overrides, patches","/docs/pm/workspaces"],["Isolated installs, no phantom deps","/docs/pm/isolated-installs"],["bun audit · why · outdated","/docs/pm/cli
1/audit"]],glyph:t("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",className:"h-7 w-7",children:[e("path",{d:"M16 3l11 6v14l-11 6-11-6V9l11-6z"}),e("path",{d:"M5 9l11 6 11-6M16 15v14"})]})},{title:"Test runner",command:"bun test",replaces:"Jest · Vitest",stamp:{lines:["replaces","Jest"],color:"green",spin:"98s"},body:"Jest-compatible expect(), mocks, snapshots, DOM and coverage â starting in milliseconds.",href:"/docs/cli/test",features:[["Jest-compatible expect() & mocks","/docs/test/writing"],["Snapshots, coverage, watch mode","/docs/test/coverage"],["Concurrent & isolated tests","/docs/cli/test"],["Works in existing Node.js projects","/docs/cli/test"]],glyph:t("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",className:"h-7 w-7",children:[e("path",{d:"M12 4h8M14 4v8L6.5 25.5A2 2 0 008.2 28.5h15.6a2 2 0 001.7-3L18 12V4"}),e("path",{d:"M9.5 20h13"})]})},{title:"Bundler",command:"bun build ./app.tsx",replaces:"esbuild · Vite · webpack",stamp:{lines:["replaces","Vite"],color:"yellow",spin:"105s"},body:"TS, JSX, CSS & HTML for browsers and servers. Dev server with HMR. Single-file executables.",href:"/docs/bundler",features:[["HTML, CSS & asset imports","/docs/bundler/html"],["Dev server with instant HMR","/docs/bundler/fullstack"],["Single-file executables","/docs/bundler/executables"],["Plugins & macros","/docs/bundler/plugins"]],glyph:t("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",className:"h-7 w-7",children:[e("rect",{x:"4",y:"6",width:"10",height:"8",rx:"1.5"}),e("rect",{x:"4",y:"18",width:"10",height:"8",rx:"1.5"}),e("rect",{x:"20",y:"11",width:"8",height:"10",rx:"1.5"}),e("path",{d:"M14 10h3v12h-3M17 16h3"})]})}];function De(){return e("section",{className:"pb-16 pt-10 md:pb-28 md:pt-16","aria-labelledby":"toolkit-heading",children:t(c,{children:[t(x,{className:"flex flex-col justify-between gap-4 md:flex-row md:items-end",children:[t("h2",{id:"toolkit-heading",className:"display text-[clamp(1.9rem,3.6vw,2.7rem)] !leading-[1.04] text-fg",children:["Four tools, designed together.",e("br",{}),e("span",{className:"text-fg-faint",children:"Adopt one, or all of them."})]}),t("p",{className:"max-w-[40ch] text-[14.5px] leading-relaxed text-fg-muted",children:[e(k,{children:"bun install"})," and ",e(k,{children:"bun test"})," drop into existing Node.js projects. No runtime switch required."]})]}),e(x,{className:"-mx-gutter mt-4 flex snap-x snap-mandatory gap-3 overflow-x-auto px-gutter pb-2 pt-7 scroll-none sm:pt-0 sm:ruled sm:mx-0 sm:mt-10 sm:grid sm:grid-cols-2 sm:gap-0 sm:overflow-visible sm:px-0 sm:pb-0 lg:grid-cols-4",children:ht.map((d)=>t(l,{href:d.href,className:"group/tool relative flex w-[78vw] max-w-[20rem] shrink-0 snap-start flex-col border border-line bg-surface p-6 transition-colors hover:bg-subtle/70 sm:w-auto sm:max-w-none sm:border-0",children:[e(je,{lines:d.stamp.lines,color:d.stamp.color,spin:d.stamp.spin,size:78,className:"absolute -right-2 -top-3 z-10 scale-90 transition-transform duration-300 group-hover/tool:rotate-12 group-hover/tool:scale-100"}),e("div",{className:"flex items-center justify-between",children:e("span",{className:"flex h-10 w-10 items-center justify-center rounded-lg border border-line bg-canvas text-fg [&_svg]:h-5 [&_svg]:w-5",children:d.glyph})}),e("h3",{className:"mt-5 text-[1.05rem] font-semibold tracking-tight text-fg",children:d.title}),t("p",{className:"mono mt-0.5 text-[11px] text-fg-faint",children:["replaces ",d.replaces]}),e("p",{className:"mt-3 flex-1 text-[13.5px] leading-relaxed text-fg-muted",children:d.body}),t("code",{className:"mt-5 block truncate rounded-lg border border-line bg-code-bg px-3 py-2 text-[12.5px] text-fg",children:[e("span",{className:"select-none text-accent",children:"$ "}),d.command]})]},d.title))})]})})}var fe=(d)=>[["av1.webm","video/webm; codecs=av01.0.05M.08"],["webm","video/webm"],["mp4","video/mp4"]].map(([m,u])=>({src:`/bun-homepage-${d}_1080p.${m}`,type:u})),qe=[{clip:{id:"claude-code-video",title:"Why Claude Code ships on Bun",person:"Boris Cherny",role:"Head of Claude Code, Anthropic",poster:"/bun-homepage-cc-boris-poster.jpg",thumb:"/bun-homepage-cc-boris-poster.webp",sources:fe("cc-boris"),track:"/bun-homepage-boris-cc.vtt"},company:"Claude Code",quote:"Claude Code ships to every developer as a Bun single-file executable.",body:e(o,{children:"Claude Code is a single file with Bun inside it. Users download it and run it. There is no install step and no startup lag."}),cta:{href:"/docs/bundler/executables",label:"Single-file executables",variant:"primary"},more:{href:"/blog/bun-joins-anthropic",label:"Bun à Anthropic"}},{clip:{id:"midjourney-video",title:"Midjourney's realtime notifications on Bun",person:"Cheng Lou",role:"Engineer, Midjourney",poster:"/bun-homepage-midjourney-cheng-poster.jpg",thumb:"/bun-homepage-midjourney-cheng-poster.webp",sources:fe("midjourney-cheng"),track:"/bun-homepage-midjourney-cheng.vtt"},company:"Midjourney",quote:"Every image notification Midjourney sends goes through Bun's WebSocket server.",body:t(o,{children:["Pub/sub, backpressure and per-message compression are built into ",e(k,{children:"Bun.serve()"})," â no ws, no socket.io, no sidecar."]}),cta:{href:"/docs/api/websockets",label:"Bun's WebSocket server",variant:"primary"},more:{href:"/guides/websocket",label:"WebSocket guides"}},{clip:{id:"railway-video-section",title:"Railway Functions run on Bun",person:"Jake Cooper",role:"Founder, Railway",poster:"/bun-homepage-railway-jake-poster.jpg",thumb:"/bun-homepage-railway-jake-poster.webp",sources:fe("railway-jake"),track:"/bun-homepage-railway-jake.vtt"},company:"Railway",quote:"Railway built its serverless Functions product on Bun.",body:e(o,{children:"A Railway Function is a TypeScript file. Bun runs it as-is, so a deploy skips the build and a cold start takes milliseconds."}),cta:{href:"https://railway.com/new/function?utm_source=bun.com",label:"Deploy on Railway",variant:"accent",external:!0},more:{href:"/guides/ecosystem",label:"Deployment guides"}}],We={id:"leerob-nextjs-video",title:"Lee Robinson on Bun and Next.js",person:"Lee Robinson",role:"VP of Developer Experience, Cursor",poster:"/bun-homepage-cursor-leerob-1-poster.jpg",thumb:"/bun-homepage-cursor-leerob-1-poster.webp",sources:fe("cursor-leerob-1"),track:"/bun-homepage-cursor-leerob-1.vtt"},$e=[...qe.map((d)=>d.clip),We];function Oe(){return e(Ae,{clips:$e,children:e("section",{className:"border-t border-rule py-16 md:py-28",children:t(c,{children:[e(x,{children:e(_,{align:"left",eyebrow:"In production",title:"Bun in production",body:"Claude Code ships to millions of developers as a Bun executable. Midjourney pushes every image notification through Bun's WebSocket server. Railway runs its serverless functions on it. Hear it from them:"})}),e(x,{className:"-mx-gutter mt-10 flex snap-x snap-mandatory gap-4 overflow-x-auto px-gutter pb-2 scroll-none md:mx-0 md:mt-14 md:grid md:grid-cols-3 md:gap-6 md:overflow-visible md:px-0 md:pb-0 [&>*]:min-w-0",children:qe.map((d,m)=>
1t(M,{className:"flex w-[84vw] max-w-[24rem] shrink-0 snap-center flex-col overflow-hidden md:w-auto md:max-w-none",children:[e(ve,{clip:d.clip,index:m,className:"aspect-video"}),t("div",{className:"flex flex-1 flex-col p-6",children:[e("p",{className:"label",children:d.company}),e("h3",{className:"font-bold tracking-[-0.015em] mt-2 text-[1.28rem] font-semibold leading-snug text-fg",children:d.quote}),e("p",{className:"mt-3 flex-1 text-[14.5px] leading-relaxed text-fg-muted",children:d.body}),e("div",{className:"mt-6",children:e(v,{href:d.cta.href,variant:d.cta.variant??"secondary",size:"sm",arrow:!0,...d.cta.external?{target:"_blank",rel:"noopener"}:{},children:d.cta.label})})]})]},d.clip.id))}),e(x,{className:"mt-6",children:t(M,{className:"grid overflow-hidden lg:grid-cols-[minmax(0,380px)_1fr] [&>*]:min-w-0",children:[e(ve,{clip:We,index:$e.length-1,size:"lg",className:"aspect-[4/3] sm:aspect-[16/10] lg:aspect-auto lg:h-full [&_img]:object-[50%_18%]"}),t("div",{className:"flex flex-col justify-center p-7 md:p-10",children:[e(we,{children:"Frameworks"}),e("h3",{className:"display mt-4 text-[clamp(1.6rem,3vw,2.3rem)] font-semibold leading-[1.05] text-fg",children:"Bun runs Next.js, Remix, Nuxt, Astro, SvelteKit, Hono, Elysia & friends."}),t("p",{className:"mt-4 max-w-[52ch] text-[15px] leading-relaxed text-fg-muted",children:["Node.js compatibility means your framework already works. Swap ",e(k,{children:"npm run dev"})," for ",e(k,{children:"bun --bun run dev"})," ","and keep shipping â with Bun's SQL, S3 and shell APIs available right inside your route handlers."]}),e(xt,{}),t("div",{className:"mt-6 flex flex-wrap items-center gap-3",children:[e(v,{href:"/guides/ecosystem/nextjs",size:"sm",arrow:!0,children:"Next.js with Bun"}),e(v,{href:"/docs/runtime/nodejs-apis",size:"sm",variant:"secondary",children:"Node.js compatibility"}),e(v,{href:"/guides/ecosystem",size:"sm",variant:"ghost",children:"All framework guides"})]})]})]})})]})})})}function xt(){let[d,m,u,g,C,p,b,P,T,j]=["text-[var(--sk-keyword)]","text-[var(--sk-type)]","text-[var(--sk-string)]","text-[var(--sk-fn)]","text-[var(--sk-param)]","text-[var(--sk-text)]","text-[var(--sk-comment)]","text-[var(--sk-const)]","text-[var(--sk-type)]","text-[var(--sk-fn)]"];return t("div",{className:"mt-6 overflow-hidden rounded-xl border border-line bg-code-bg",children:[e("div",{className:"mono flex items-center gap-2 border-b border-line px-4 py-2 text-[11.5px] text-fg-faint",children:"app/blog/[slug]/page.tsx"}),e("pre",{className:"m-0 overflow-x-auto px-4 py-3.5 text-[12.5px] leading-[1.7] text-[var(--sk-text)]",children:[[0,[d,"import"]," { ",[m,"s3"],", ",[m,"$"],", ",[m,"sql"]," } ",[d,"from"]," ",[u,'"bun"'],";"],[0],[0,[d,"export default async function"]," ",[g,"BlogPage"],"({ ",[C,"params"]," }) {"],[2,[d,"const"]," [",[p,"post"],"] = ",[d,"await"]," ",[m,"sql"],[b,"`"],[P,"SELECT"]," ",[T,"*"]," ",[P,"FROM"]," ",[T,"posts"]," ",[P,"WHERE"]," ",[T,"slug"]," = ",[b,"${"],[C,"params"],".",[j,"slug"],[b,"}`"],";"],[2,[d,"const"]," ",[p,"img"]," = ",[m,"s3"],".",[g,"file"],"(",[p,"post"],".",[j,"imageKey"],").",[g,"presign"],"();"],[2,[d,"const"]," ",[p,"words"]," = ",[d,"await"]," ",[m,"$"],[b,"`"],[g,"wc"]," -w < ",[b,"${"],[p,"post"],".",[j,"file"],[b,"}`"],".",[g,"text"],"();"],[2,[d,"return"]," <",[u,"Article"]," ",[j,"post"],"={",[p,"post"],"} ",[j,"img"],"={",[p,"img"],"} ",[j,"words"],"={",[p,"words"],"} />;"],[0,"}"]].map(([H,...J],Z)=>t("div",{children:[J.length?" ".repeat(H):" ",J.map((Y,ee)=>typeof Y==="string"?Y:e("span",{className:Y[0],children:Y[1]},ee))]},Z))})]})}function ze({tabs:d}){let[m,u]=s(d[0]?.key),g=I(),C=Math.max(0,d.findIndex((b)=>b.key===m));return e("section",{className:"border-t border-rule py-16 md:py-28",children:t(c,{children:[e(x,{children:e(_,{eyebrow:"Batteries included",align:"left",title:"The APIs you need, baked in.",body:"Most servers need an HTTP stack, a database client, Redis, S3, hashing and a way to shell out. Bun ships all of them, so that is a stack of packages you never install or patch."})}),t(x,{className:"mt-14 grid gap-6 lg:grid-cols-[minmax(0,300px)_1fr]",children:[e("div",{role:"tablist","aria-label":"API examples","aria-orientation":"vertical",onKeyDown:(b)=>{let P=C;if(b.key==="ArrowDown"||b.key==="ArrowRight")P=(P+1)%d.length;else if(b.key==="ArrowUp"||b.key==="ArrowLeft")P=(P-1+d.length)%d.length;else return;b.preventDefault(),u(d[P].key),document.getElementById(`${g}-t-${d[P].key}`)?.focus()},className:"flex gap-1.5 overflow-x-auto pb-1 scroll-none lg:flex-col lg:overflow-visible",children:d.map((b)=>t("button",{id:`${g}-t-${b.key}`,type:"button",role:"tab","aria-selected":b.key===m,"aria-controls":`${g}-p-${b.key}`,tabIndex:b.key===m?0:-1,onClick:()=>u(b.key),className:n("api-tab group/tab flex shrink-0 items-center gap-3 rounded-xl px-3.5 py-2.5 text-left text-[14px] text-fg-muted transition-[background,color,box-shadow] hover:text-fg",b.key===m&&"active"),children:[e("span",{className:"api-tab-dot h-1.5 w-1.5 shrink-0 rounded-full bg-line-strong transition-colors","aria-hidden":!0}),e("span",{className:"whitespace-nowrap font-medium",children:b.label})]},b.key))}),e("div",{className:"min-w-0",children:d.map((b)=>e("div",{role:"tabpanel",id:`${g}
1-p-${b.key}`,"aria-labelledby":`${g}-t-${b.key}`,hidden:b.key!==m,children:t(M,{className:"overflow-hidden ",children:[t("div",{className:"flex items-center justify-between gap-4 border-b border-line px-5 py-3",children:[e("p",{className:"text-[14px] text-fg-muted",children:b.blurb}),e(R,{href:b.href,className:"shrink-0 text-[13px]",children:"Docs"})]}),e(F,{block:b.block,className:"!rounded-none !border-0 text-[13.5px]"})]})},b.key))})]})]})})}var Ie=[{title:"HTTP & WebSockets",items:[["/docs/api/http","Bun.serve()","HTTP, routing & WebSockets"],["/docs/api/cookie","request.cookies","Zero-overhead cookies"],["/docs/api/fetch","fetch","HTTP/2, proxies, unix sockets"]]},{title:"Data",items:[["/docs/api/sql","Bun.sql","Postgres, MySQL, SQLite"],["/docs/api/redis","Bun.redis","Redis client & Pub/Sub"],["/docs/api/s3","Bun.s3","S3-compatible storage"]]},{title:"Files & processes",items:[["/docs/api/file-io","Bun.file()","Lazy, fast file I/O"],["/docs/runtime/shell","Bun.$","Cross-platform shell"],["/docs/api/spawn","Bun.spawn()","Child processes & IPC"]]},{title:"Security",items:[["/docs/api/hashing","Bun.password","argon2 & bcrypt"],["/docs/api/csrf","Bun.CSRF","CSRF tokens"],["/docs/api/secrets","Bun.secrets","OS keychain"]]},{title:"Formats",items:[["/docs/api/yaml","Bun.YAML","YAML & TOML imports"],["/docs/api/markdown","Bun.markdown","CommonMark â HTML"],["/docs/api/utils","Bun.escapeHTML()","and 40+ utilities"]]},{title:"Low level",items:[["/docs/api/ffi","bun:ffi","Call C, Rust, Zig"],["/docs/api/workers","Worker","Threads & structuredClone"],["/docs/api/glob","Bun.Glob","Fast glob matching"]]}];function Je(){let[d,m]=s(!1);return e("section",{className:"bg-canvas pb-24 md:pb-32",children:t(c,{children:[t(x,{className:"flex flex-col items-start justify-between gap-4 md:flex-row md:items-end",children:[e("h3",{className:"display text-[clamp(1.5rem,2.8vw,2rem)] font-semibold leading-tight text-fg",children:"â¦and the rest of the standard library"}),e(v,{href:"/reference",variant:"secondary",size:"sm",arrow:!0,children:"Full API reference"})]}),e("div",{className:n("ruled mt-8 grid sm:grid-cols-2 lg:grid-cols-3",!d&&"max-sm:[&>*:nth-child(n+3)]:hidden"),children:Ie.map((u)=>t("div",{className:"bg-surface p-6",children:[e("h3",{className:"label",children:u.title}),e("ul",{className:"mt-4 space-y-1",children:u.items.map(([g,C,p])=>e("li",{children:t(l,{href:g,className:"group/bi -mx-2 flex items-center justify-between gap-3 rounded-lg px-2 py-2 transition-colors hover:bg-subtle",children:[t("span",{className:"min-w-0",children:[e("code",{className:"text-[13.5px] text-accent-strong",children:C}),e("span",{className:"block truncate text-[13px] text-fg-muted",children:p})]}),e(G,{className:"h-4 w-4 shrink-0 text-fg-faint opacity-0 transition-[opacity,transform] group-hover/bi:translate-x-0.5 group-hover/bi:opacity-100"})]})},g+C))})]},u.title))}),!d?t("button",{type:"button",onClick:()=>m(!0),className:"label mt-4 border border-rule px-3 py-2 text-[11px] text-fg sm:hidden",children:["Show every built-in (",Ie.reduce((u,g)=>u+g.items.length,0),")"]}):null]})})}function Ve(){return e("section",{className:"border-t border-line py-16 md:py-28",children:t(c,{className:"grid items-center gap-14 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)] lg:gap-20",children:[t(x,{children:[e(_,{align:"left",eyebrow:"Frontend",title:"Full speed, fullâstack",body:t(o,{children:["Point Bun at an HTML file and you get a dev server with instant hot reloading, then ",e(k,{children:"bun build --production"})," for optimized bundles. React, TypeScript, Tailwind and CSS imports work out of the box."]})}),e("ol",{className:"mt-8 space-y-5",children:[["bun init --react","Scaffold a React app (or add index.html to any project)."],["bun ./index.html","Dev server with HMR that preserves state; browser logs stream to your terminal."],["bun build ./index.html --production","Tree-shaken, minified, code-split bundles."]].map(([d,m],u)=>t("li",{className:"grid grid-cols-[28px_1fr] gap-3",children:[e("span",{className:"mono mt-0.5 flex h-6 w-6 items-center justify-center rounded-full border border-line bg-surface text-[11px] text-fg-muted",children:u+1}),t("div",{children:[e("code",{className:"text-[14px] text-fg",children:d}),e("p",{className:"mt-0.5 text-[14.5px] text-fg-muted",children:m})]})]},d))}),e("div",{className:"mt-8",children:e(R,{href:"/docs/bundler/fullstack",children:"Full-stack apps with Bun"})})]}),e(x,{delay:100,children:t("div",{className:"overflow-hidden rounded-2xl border border-line bg-surface ",children:[t("div",{className:"flex items-center gap-1.5 border-b border-line bg-subtle/70 px-4 py-2.5",children:[e("span",{className:"h-2.5 w-2.5 rounded-full bg-line-strong"}),e("span",{className:"h-2.5 w-2.5 rounded-full bg-line-strong"}),e("span",{className:"h-2.5 w-2.5 rounded-full bg-line-strong"}),e("span",{className:"mono ml-3 text-[11.5px] text-fg-faint",children:"bun ./index.html â hot reloading"})]}),e(vt,{})]})})]})})}
1function vt(){let[d,m]=y({rootMargin:"100% 0px"}),u=r(null);return a(()=>{if(m)u.current?.load()},[m]),e("div",{ref:d,children:e("video",{ref:u,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,width:1230,height:1080,className:"block h-auto w-full","aria-label":"Bun's frontend dev server hot reloading a React app",children:m?t(o,{children:[e("source",{src:"/bun-frontend-hmr-demo.webm",type:"video/webm"}),e("source",{src:"/bun-frontend-hmr-demo.mp4",type:"video/mp4"})]}):null})})}var q=(d,m,u,g,C,p)=>({name:d,description:m,docsUrl:u,bun:g,node:C,deno:p}),_e=[{title:"Runtime",features:[q("Node.js compatibility","Aiming to be a drop-in replacement for Node.js apps","/docs/runtime/nodejs-apis","partial",!0,"partial"),q("Web Standard APIs","`fetch`, `URL`, `EventTarget`, `Headers`, streamsâ¦","/docs/api/fetch",[!0,"Powered by WebCore (from WebKit/Safari)"],!0,!0),q("TypeScript",'First-class, including `"paths"`, `enum`, `namespace`',"/docs/runtime/typescript",!0,"partial",!0),q("JSX","First-class support without configuration","/docs/runtime/jsx",!0,!1,!0),q("Native addons","Call C-compatible native code from JavaScript","/docs/api/ffi",[!0,"bun:ffi, N-API, partial V8 C++ API"],!0,!0),q("Module loader plugins","Import custom file types","/docs/runtime/plugins",[!0,"`Bun.plugin` works in browsers & Bun"],["partial","3 different loader APIs, server-side only"],!1)]},{title:"Built-in APIs",features:[q("PostgreSQL, MySQL & SQLite drivers","One fast, unified SQL API","/docs/api/sql",[!0,"Fastest available, with query pipelining"],!1,!1),q("S3 client","Upload and download from S3-compatible storage","/docs/api/s3",[!0,"Fastest available"],!1,!1),q("Redis client","With Pub/Sub","/docs/api/redis",!0,!1,!1),q("HTTP server & router","Dynamic routes and wildcards in `Bun.serve()`","/docs/api/http",[!0,"Bun.serve({ routes })"],["partial","Server, no router"],["partial","Server, no router"]),q("WebSocket server with pub/sub","Built into `Bun.serve()` with backpressure","/docs/api/websockets",!0,!1,"partial"),q("Single-file executables","Compile to a standalone binary that runs anywhere","/docs/bundler/executables",[!0,"Cross-compilation, embedded files, bytecode & code signing"],["partial","No native addons, embedded files, cross-compilation or bytecode"],["partial","No native addons, no cross-compilation"]),q("YAML, TOML, Markdown","First-class parsers and imports","/docs/api/yaml",!0,!1,!1),q("Cookies & CSRF","Map-like cookies API, CSRF tokens","/docs/api/cookie",!0,!1,!1),q("Encrypted secrets storage","OS keychain / libsecret / Credential Manager","/docs/api/secrets",!0,!1,!1)]},{title:"Tooling",features:[q("Package manager","Install, manage & publish npm packages","/docs/cli/install",[!0,"Catalogs, isolated installs, audit, why"],!0,["partial","Limited features"]),q("Bundler","Production builds for frontend & backend","/docs/bundler",!0,!1,!1),q("Frontend dev server","HMR, browser â terminal logs","/docs/bundler/html",!0,!1,!1),q("Jest-compatible test runner","With VS Code integration & concurrent execution","/docs/cli/test",!0,["partial","node:test, not Jest-compatible"],["partial","Deno.test, not Jest-compatible"]),q("Cross-platform $ shell","bash-like scripting on every OS","/docs/runtime/shell",!0,!1,[!1,"Requires dax"]),q("Server hot reloading","Reload code without dropping connections","/docs/runtime/hot",!0,!1,!1),q("Monorepo support","Workspaces, --filter, catalogs","/docs/cli/filter",!0,["partial","Workspaces only"],"partial"),q("Formatter & linter","Built in",null,!1,!1,!0)]}];function ye({value:d,align:m}){let[u,g]=Array.isArray(d)?d:[d,void 0],C=u===!0?{cls:"bg-success/15 text-success",label:"Yes",icon:e(z,{className:"h-3.5 w-3.5"})}:u==="partial"?{cls:"bg-warning/15 text-warning",label:"Partial",icon:e("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":!0,children:e("path",{d:"M3 8h10"})})}:{cls:"bg-fg/[0.06] text-fg-faint",label:"No",icon:e("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":!0,
1children:e("path",{d:"M4.5 4.5l7 7M11.5 4.5l-7 7"})})};return e("td",{className:"px-1 py-3 text-center align-middle sm:px-4 sm:py-3.5",children:t("span",{className:"group/tip relative inline-flex",children:[e("span",{className:n("inline-flex h-7 w-7 items-center justify-center rounded-full",C.cls),"aria-label":C.label+(g?`: ${g}`:""),role:"img",children:C.icon}),g?e("span",{className:n("pointer-events-none absolute bottom-[calc(100%+8px)] z-20 hidden w-max max-w-[240px] rounded-lg bg-fg px-2.5 py-1.5 text-center text-[12px] leading-snug text-canvas opacity-0 transition-opacity group-hover/tip:opacity-100 md:block",m==="end"?"right-0":"left-1/2 -translate-x-1/2"),children:e(N,{content:g,codeClassName:"mono text-[11px]"})}):null]})})}var yt=600,Fe=9;function Ue(){let[d,m]=s(!1),[u,g]=s(yt),C=r(null),p=_e.reduce((T,j)=>T+j.features.length,0),b=()=>{let T=C.current;m(!0),g(T?T.scrollHeight:"auto")},P=0;return e("section",{className:"border-t border-rule py-16 md:py-28","aria-labelledby":"compare-heading",children:t(c,{children:[e(x,{children:e("h2",{id:"compare-heading",className:"display max-w-[18ch] text-balance text-[clamp(2.6rem,6vw,4.75rem)] text-fg",children:"Bun is a complete toolkit."})}),e("div",{className:"mt-12 rounded-2xl border border-line bg-surface ",children:t("div",{ref:C,"data-expanded":d?"":void 0,className:n("compare-wrap relative transition-[height] duration-[900ms] ease-[cubic-bezier(.16,1,.3,1)]",u==="auto"?"overflow-x-auto md:overflow-visible":"overflow-hidden"),style:{height:u},onTransitionEnd:(T)=>T.propertyName==="height"&&T.target===T.currentTarget&&g("auto"),children:[t("table",{className:"w-full border-collapse text-left",children:[e("thead",{children:t("tr",{className:"border-b border-line bg-subtle/60 text-[13px] [&>th:first-child]:rounded-tl-2xl [&>th:last-child]:rounded-tr-2xl",children:[e("th",{className:"px-3 py-3 font-medium text-fg-faint sm:px-6",children:"Feature"}),e("th",{className:"w-12 px-1 py-3 text-center sm:w-28 sm:px-4",children:t("span",{className:"inline-flex items-center gap-1.5 font-semibold text-fg",children:[e("img",{src:"/logo.svg",alt:"",className:"h-5 w-5"})," ",e("span",{className:"hidden sm:inline",children:"Bun"})]})}),t("th",{className:"w-12 px-1 py-3 text-center text-[12px] font-medium text-fg-muted sm:w-28 sm:px-4 sm:text-[13px]",children:["Node",e("span",{className:"hidden sm:inline",children:".js"})]}),e("th",{className:"w-12 px-1 py-3 text-center text-[12px] font-medium text-fg-muted sm:w-28 sm:px-4 sm:text-[13px]",children:"Deno"})]})}),_e.map((T)=>t("tbody",{children:[e("tr",{children:e("th",{colSpan:4,scope:"colgroup",className:"mono border-b border-line bg-subtle/40 px-3 py-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-fg-faint sm:px-6",children:T.title})}),T.features.map((j)=>{let X=P++,H=X>=Fe;return t("tr",{"data-late":H?"":void 0,"aria-hidden":H&&!d?!0:void 0,style:H?{"--d":X-Fe}:void 0,className:n("border-b border-line transition-colors last:border-b-0 hover:bg-canvas",H&&!d&&"invisible"),children:[t("th",{scope:"row",className:"px-3 py-3 text-[14px] font-normal sm:px-6 sm:py-3.5 sm:text-[15px]",children:[j.docsUrl?e(l,{href:j.docsUrl,className:"font-medium text-fg underline decoration-transparent underline-offset-4 transition-colors hover:decoration-line-strong",children:j.name}):e("span",{className:"font-medium text-fg",children:j.name}),e("div",{className:"mt-0.5 hidden text-[13px] text-fg-muted md:block",children:e(N,{content:j.description})})]}),e(ye,{value:j.bun}),e(ye,{value:j.node}),e(ye,{value:j.deno,align:"end"})]},j.name)})]},T.title))]}),e("div",{className:n("pointer-events-none absolute inset-x-0 bottom-0 z-10 flex h-28 items-end justify-center border-t border-rule bg-canvas pb-6 pt-6 transition-[opacity,transform] duration-500 ease-out",d&&"translate-y-6 opacity-0"),children:t("button",{type:"button",onClick:b,"aria-expanded":d,tabIndex:d?-1:0,className:"pointer-events-auto group/more inline-flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2 text-[13.5px] font-medium text-fg transition-[background,box-shadow,transform] hover:-translate-y-
1px hover:bg-subtle hover:active:translate-y-0",children:["Show all ",p," rows",e("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 transition-transform duration-300 group-hover/more:translate-y-0.5",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:e("path",{d:"M4 6l4 4 4-4"})})]})})]})})]})})}var ss=[["Aiden Bai","@aidenybai","2025 will be the year of JS/TS and @bunjavascript is why"],["Michael Feldstein","@msfeldstein","holy shit bun is the solution to spending all day mucking around with typescript/module/commonjs/import bullshit and just running scripts"],["Catalin","@catalinmpit","Bun is goated"],["Hirbod","@hirbod_dev","For everything. Yes. I even run with bunx expo run:ios etc"],["buraks","@buraks____","I use bun patch and I love it!"],["MadMax","@dr__madmax","@bunjavascript is yet to get enough appreciation it deserves."],["tiago","@tiagorangel23","should have used Bun instead of npm"],["Baggi/e","@ManiSohi","Performant TS/JS backend needs more love. Elysia for the win"],["Luis Paolini","@DigitalLuiggi","Jus use @bunjavascript"],["SaltyAom","@saltyAom","bun"],["Samuel","@samueldans0","Bun always"],["orlowdev","@orlowdev","Yeah, bun, but my code does not have dependencies."],["Divin Prince","@divinprnc","Yeah Bun"],["Ayu","@Ayuu2809","Bun good \uD83E\uDDC5"],["reaxios","@reaxios","bun install bun"],["std::venom","@std_venom","Bun"],["emanon","@0x_emanon","â
bun"],["Stefan","@stefangarofalo","Bun"]].map(([d,m,u])=>({author:d,handle:m,content:u}));function Ye(){return e("section",{className:"dark border-t border-rule bg-canvas text-fg",children:t(c,{className:"grid gap-10 py-16 md:py-[min(7rem,12vh)] lg:grid-cols-[minmax(0,1.25fr)_minmax(0,1fr)] lg:items-end lg:gap-12 [&>*]:min-w-0",children:[t("div",{children:[e("img",{src:"/logo.svg",alt:"",width:80,height:70,className:"h-14 w-auto md:h-16"}),t("h2",{className:"display-x mt-6 text-[clamp(3rem,min(9vw,13vh),7.5rem)] text-fg",children:["Try it on the repo",e("br",{}),"you have ",e("span",{className:"text-accent",children:"open"}),e("br",{}),e("span",{className:"text-accent",children:"right now."})]})]}),t("div",{className:"lg:pb-3",children:[t("p",{className:"max-w-[40ch] text-[1.1rem] leading-[1.5] text-fg-muted md:text-[1.2rem]",children:["Install Bun, open the project you were already working on, and run ",e("code",{className:"readout text-[0.92em] text-accent",children:"bun install"}),". Your code, dependencies and scripts stay exactly as they are."]}),e(ne,{className:"mt-8"}),t("div",{className:"mt-5 flex flex-wrap gap-3",children:[e(v,{href:"/docs/quickstart",variant:"accent",size:"lg",arrow:!0,children:"Quickstart"}),e(v,{href:"/docs/installation",variant:"secondary",size:"lg",children:"Other ways to install"})]})]})]})})}function Ge({data:d}){return e("section",{className:"border-t border-rule py-16 md:py-28","aria-labelledby":"spotlight-heading",children:e(c,{children:t(x,{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)] lg:gap-16",children:[t("div",{children:[t("p",{className:"mono flex items-center gap-3 text-[11px] font-medium uppercase tracking-[0.14em] text-fg-faint",children:[t("span",{className:"rounded-full bg-fg px-2 py-0.5 tracking-[0.08em] text-canvas",children:["v",d.version]}),d.kicker," · ",d.date]}),e("h2",{id:"spotlight-heading",className:"display mt-5 text-balance text-[clamp(2.6rem,6vw,4.75rem)] text-fg",children:d.title}),e("p",{className:"mt-4 max-w-[52ch] text-[1.02rem] leading-relaxed text-fg-muted md:text-[1.08rem]",children:d.lede}),t("div",{className:"mt-7 flex flex-wrap items-center gap-3",children:[e(v,{href:d.href,arrow:!0,children:"Read the release notes"}),t("code",{className:"rounded-full border border-line bg-surface px-3.5 py-2 text-[13px] text-fg-muted",children:[e("span",{className:"select-none text-accent",children:"$ "}),"bun upgrade"]})]})]}),t("div",{children:[d.stats?.length?e("dl",{className:"ruled grid grid-cols-2",children:d.stats.map((m)=>t("div",{className:"bg-surface p-5",children:[e("dt",{className:"mono text-[11px] uppercase tracking-[0.12em] text-fg-faint",children:m.label}),t("dd",{className:"mt-2",children:[t("span",{className:"display flex items-baseline gap-1 text-[clamp(2rem,4vw,2.8rem)] font-bold leading-none tabular-nums text-fg",children:[m.value,m.unit?e("span",{className:"text-[0.45em] font-medium tracking-normal text-fg-muted",children:m.unit}):null]}),m.note?e("span",{className:"mt-2 block text-[12.5px] leading-snug text-fg-muted",children:m.note}):null]})]},m.label))}):null,e("ul",{className:n("grid gap-x-8 gap-y-2.5 sm:grid-cols-2",d.stats?.length?"mt-8":""),children:d.highlights.map((m)=>{let u=t(o,{children:[e("span",{className:"mt-[9px] h-1 w-1 shrink-0 rounded-full bg-accent","aria-hidden":!0}),t("span",{className:"text-[14.5px] leading-relaxed text-fg-muted",children:[m.code?e("code",{className:"mr-1 text-[13px] text-fg",children:m.code}):null,m.text]})]});return e("li",{children:m.href?e(l,{href:m.href,className:"flex items-start gap-3 rounded-lg transition-colors hover:[&_span:last-child]:text-fg",children:u}):e("span",{className:"flex items-start gap-3",children:u})},m.text)})}),e("div",{className:"mt-6",children:e(R,{href:"/blog",className:"text-[14px]",children:"All releases"})})]})]})})})}i();var h=(d)=>e("span",{className:"text-fg-faint",children:d}),W=(d)=>e("span",{className:"text-success",children:d}),le=(d)=>e("span",{className:"text-accent-strong",children:d}),ce=(d)=>e("span",{className:"font-semibold text-fg",children:d}),Ke=(d)=>e("span",{className:"text-info",children:d}),me=[{key:"install",n:"01",title:"Install dependencies",cmd:"bun install",blurb:"Reads your package.json, migrates your lockfile, and installs from a global cache â up to 30à faster than npm.",href:"/docs/cli/install",lines:[{t:0,text:h(`bun install v${E} (0aa2b1cd)`)},{t:40,text:t(o,{children:[h(" \uD83D\uDD0D Resolving")," ",h("[712/712]")]})},{t:1180,text:t(o,{children:[W("+")," react",h("@19.1.0")]})},{t:1184,text:t(o,{children:[W("+")," react-dom",h("@19.1.0")]})},{t:1188,text:t(o,{children:[W("+")," next",h("@15.4.1")]})},{t:1192,text:t(o,{children:[W("+")," tailwindcss",h("@4.1.11")]})},{t:1196,text:t(o,{children:[W("+")," typescript",h("@5.9.2")," ",h("(+ 706 more)")]})},{t:1200,text:""},{t:1200,text:t(o,{children:[ce(" 712 packages")," installed ",le("[1.18s]")]})}]},{key:"dev",n:"02",title:"Start a frontend dev server",cmd:"bun ./index.html",blurb:"Point Bun at an HTML file: React, TypeScript, Tailwind and CSS just work, with hot reloading that keeps state.",href:"/docs/bundler/html",lines:[{t:0,text:t(o,{children:[le(" DEV ")," ",ce(`Bun v${E}`)," ",h("ready in")," ",ce("6.62"),h("ms")]})},{t:7,text:""},{t:7,text:t(o,{children:[le("â")," ",Ke("http://localhost:3000/")]})},{t:8,text:""},{t:8,text:h("Routes:")},{t:9,text:t(o,{children:[h(" ââ /")," ",h("â")," index.html"]})},{t:30,text:t(o,{children:[W("Bundled page in 21ms:")," index.html ",h("(app.tsx, styles.css + 84 modules)")]})},{t:1400,text:t(o,{children:[h("[hmr]")," app.tsx ",h("reloaded in")," ",ce("4ms")]})},{t:2200,text:t(o,{children:[h("[hmr]")," styles.css ",h("reloaded in")," ",ce("2ms")]})}]},{key:"run",n:"03",title:"Run TypeScript directly",cmd:"bun run server.ts",blurb
1:"No build step, no ts-node. Bun.serve() handles HTTP, routing and WebSockets; SQL, Redis and S3 clients are built in.",href:"/docs/cli/run",lines:[{t:15,text:t(o,{children:["Listening on ",Ke("http://localhost:3000")]})},{t:500,text:t(o,{children:[h("12:04:01")," ",W("200")," GET / ",h("0.21ms")]})},{t:800,text:t(o,{children:[h("12:04:01")," ",W("200")," GET /api/users/42 ",h("1.94ms")," ",h("(1 query)")]})},{t:1100,text:t(o,{children:[h("12:04:02")," ",W("101")," GET /chat ",h("â websocket upgrade")]})},{t:1400,text:t(o,{children:[h("12:04:02")," ",W("200")," POST /api/upload ",h("3.10ms")," ",h("(s3 put 1.2 MB)")]})},{t:1700,text:t(o,{children:[h("12:04:03")," ",W("200")," GET /api/users/7 ",h("0.88ms")," ",h("(cached)")]})}]},{key:"test",n:"04",title:"Run your test suite",cmd:"bun test",blurb:"Jest-compatible expect(), mocks, snapshots and DOM testing â starting in milliseconds instead of seconds.",href:"/docs/cli/test",lines:[{t:0,text:h(`bun test v${E} (0aa2b1cd)`)},{t:2,text:""},{t:2,text:h("src/math.test.ts:")},{t:3,text:t(o,{children:[W("â")," math ",h(">")," addition ",h("[0.08ms]")]})},{t:16,text:t(o,{children:[W("â")," math ",h(">")," fetches a user ",h("[12.41ms]")]})},{t:17,text:t(o,{children:[W("â")," math ",h(">")," mocks ",h("[0.11ms]")]})},{t:20,text:h("src/router.test.tsx:")},{t:24,text:t(o,{children:[W("â")," ","<App />"," ",h(">")," renders the dashboard ",h("[3.02ms]")]})},{t:25,text:t(o,{children:[W("â")," ","<App />"," ",h(">")," matches snapshot ",h("[0.61ms]")]})},{t:38,text:""},{t:38,text:e(o,{children:W(" 5 pass")})},{t:38,text:e(o,{children:h(" 0 fail")})},{t:38,text:t(o,{children:["Ran 5 tests across 2 files. ",le("[38.00ms]")]})}]},{key:"compile",n:"05",title:"Ship a single binary",cmd:"bun build ./cli.ts --compile --outfile todo",blurb:"Bundle your app and the Bun runtime into one executable. Cross-compile for Linux, macOS and Windows from any machine.",href:"/docs/bundler/executables",lines:[{t:3,text:t(o,{children:[h(" [3ms]")," ",W("bundle")," 14 modules"]})},{t:95,text:t(o,{children:[h(" [92ms]")," ",W("compile")," todo"]})},{t:640,text:""},{t:640,text:t(o,{children:[le("$")," ./todo --help"]})},{t:652,text:t(o,{children:[ce("todo")," ",h("1.0.0")]})},{t:652,text:t(o,{children:[h("Usage:")," todo ","<command>"]})},{t:652,text:""},{t:652,text:t(o,{children:[" add ",h("<text>")," add a task"]})},{t:652,text:e(o,{children:" list show open tasks"})},{t:652,text:t(o,{children:[" done ",h("<id>")," complete a task"]})},{t:1500,text:""},{t:1500,text:t(o,{children:[le("$"),' ./todo add "ship it"']})},{t:1512,text:t(o,{children:[W("â")," ",h("#1")," ship it"]})}],hold:2600}],ke=24,Qe=2400;function wt(d,m,u,g,C){let[p,b]=s(g?d.cmd.length:0),[P,T]=s(g?d.lines.length:0),j=r(C);j.current=C;let X=r(u);return X.current=u,a(()=>{if(g){b(d.cmd.length),T(d.lines.length);return}if(b(0),T(0),!m)return;let H=350+d.cmd.length*ke+280,J=[];for(let D=1;D<=d.cmd.length;D++)J.push([350+D*ke,()=>b(D)]);d.lines.forEach((D,O)=>J.push([H+D.t,()=>T(O+1)]));let Z=H+(d.lines[d.lines.length-1]?.t??0)+(d.hold??Qe);J.push([Z,()=>j.current()]);let Y=0,ee=performance.now(),V=0,K=requestAnimationFrame(function D(O){if(!X.current)Y+=O-ee;ee=O;while(V<J.length&&J[V][0]<=Y)J[V++][1]();if(V<J.length)K=requestAnimationFrame(D)});return()=>cancelAnimationFrame(K)},[d,m,g]),{typed:p,shown:P}}function Nt({step:d,playing:m,paused:u,instant:g,onDone:C}){let{typed:p,shown:b}=wt(d,m,u,g,C),P=p>=d.cmd.length;return t("div",{className:"dark overflow-hidden rounded-2xl border border-black/80 bg-[rgb(17_17_20)] text-fg ring-1 ring-white/[0.06] dark:border-line",children:[t("div",{className:"flex items-center gap-1.5 border-b border-white/[0.06] px-4 py-3",children:[e("span",{className:"h-2.5 w-2.5 rounded-full bg-white/15"}),e("span",{className:"h-2.5 w-2.5 rounded-full bg-white/15"}),e("span",{className:"h-2.5 w-2.5 rounded-full bg-white/15"}),e("span",{className:"mono ml-3 text-[11.5px] text-white/40",children:"~/my-app â bun"}),t("span",{className:"mono ml-auto text-[11px] text-white/30",children:[d.n," / 0",me.length]}
1),e("img",{src:"/logo.svg",alt:"","aria-hidden":!0,className:n("ml-2 h-5 w-5 transition-transform duration-300",P&&b===d.lines.length?"animate-[hop_.6s_var(--ease-out)_1]":"")})]}),t("pre",{className:"m-0 h-[22.5rem] overflow-hidden px-5 py-4 text-[13px] leading-[1.7]","aria-live":"polite","aria-label":`Terminal output for ${d.cmd}`,children:[t("div",{children:[e("span",{className:"text-accent",children:"$ "}),e("span",{children:d.cmd.slice(0,p)}),!P||b===0?e("span",{className:"blink ml-px inline-block h-[1.05em] w-[0.55em] bg-white/70 align-text-bottom"}):null]}),d.lines.slice(0,b).map((T,j)=>e("div",{className:"animate-fade-in [animation-duration:.25s]",children:T.text===""?" ":T.text},j)),P&&b===d.lines.length?t("div",{children:[e("span",{className:"text-accent",children:"$ "}),e("span",{className:"blink inline-block h-[1.05em] w-[0.55em] bg-white/70 align-text-bottom"})]}):null]})]})}function Xe(){let d=Ne(),[m,u]=s(0),[g,C]=s(0),[p,b]=s(!1),[P,T]=s(!1),[j,X]=s(0),H=r(null),J=r(!1),Z=r(!1),Y=r(()=>{});J.current=P,a(()=>{let D=H.current;if(!matchMedia("(min-width: 1024px)").matches)return;if(!D||!("IntersectionObserver"in window))return void b(!0);let O=new IntersectionObserver(([Q])=>{if(Q.isIntersecting){if(b(!0),T(!1),Z.current)Y.current()}else T(!0)},{threshold:0.3});return O.observe(D),()=>O.disconnect()},[]);let ee=me[m],V=(D)=>{Z.current=!1,u((D+me.length)%me.length),X((O)=>O+1),b(!0)};Y.current=()=>V(m+1);let K=()=>{if(T(!1),Z.current)V(m+1)};return e("section",{ref:H,className:"border-t border-line py-16 md:py-28","aria-labelledby":"tour-heading",children:e(c,{children:t("div",{className:"grid items-start gap-12 lg:grid-cols-[minmax(0,0.8fr)_minmax(0,1.2fr)] lg:items-center lg:gap-16",children:[t("div",{children:[e("p",{className:"label",children:"A minute with Bun"}),e("h2",{id:"tour-heading",className:"display mt-4 text-balance text-[clamp(2.6rem,6vw,4.75rem)] text-fg",children:"One binary for the whole workflow."}),t("p",{className:"mt-4 max-w-[46ch] text-[1.02rem] leading-relaxed text-fg-muted",children:["Install, develop, run, test and ship with the same tool. Every step below is a real command with real output",e("span",{className:"hidden lg:inline",children:" â click one, or just watch"}),"."]}),e("ol",{className:"mt-6 flex flex-col border-y border-line lg:mt-8 lg:border-0",role:"tablist","aria-orientation":"vertical",onMouseLeave:K,children:me.map((D,O)=>{let Q=O===m;return e("li",{role:"presentation",className:"relative border-b border-line last:border-b-0 lg:border-0",onMouseEnter:()=>T(!0),children:t("button",{type:"button",role:"tab","aria-selected":Q,"aria-expanded":g===O,"aria-controls":"tour-terminal",onClick:()=>matchMedia("(min-width: 1024px)").matches?V(O):C((oe)=>oe===O?-1:O),className:n("group/step relative grid w-full grid-cols-[2.25rem_1fr] gap-3 px-1 py-3.5 text-left transition-colors lg:rounded-xl lg:px-3 lg:py-3",Q?"lg:bg-subtle":"lg:hover:bg-subtle/60"),children:[e("span",{className:n("mono pt-0.5 text-[11px] tabular-nums",Q?"lg:text-accent-strong":"","text-fg-faint"),children:D.n}),t("span",{className:"min-w-0",children:[t("span",{className:n("flex items-center justify-between gap-3 text-[15px] font-medium text-fg",!Q&&"lg:text-fg-muted lg:group-hover/step:text-fg"),children:[D.title,e("svg",{viewBox:"0 0 16 16",className:n("h-3.5 w-3.5 shrink-0 text-fg-faint transition-transform lg:hidden",g===O&&"rotate-180"),fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"square","aria-hidden":!0,children:e("path",{d:"M4 6l4 4 4-4"})})]}),t("code",{className:n("mt-0.5 block truncate text-[12.5px]",Q?"text-fg-muted":"text-fg-faint"),children:["$ ",D.cmd]}),e("span",{className:n("grid overflow-hidden text-[14px] leading-relaxed text-fg-muted transition-[grid-template-rows,opacity] duration-300",g===O?"mt-2 grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0",Q?"lg:mt-2 lg:grid-rows-[1fr] lg:opacity-100":"lg:mt-0 lg:grid-rows-[0fr] lg:opacity-0"),children:t("span",{className:"min-h-0",children:[D.blurb," ",e(R,{href:D.href,className:"text-[13px]",onClick:(oe)=>oe.stopPropagation(),children:"Docs"})]})})]}),Q&&p&&!d?e("span",{className:"absolute inset-x-3 bottom-0 hidden h-px origin-left bg-accent/60 [animation:bar-grow_linear_both] lg:block",style:{animationDuration:`${St(D)}ms`,animationPlayState:P?"paused":"running"},"aria-hidden":!0},j):null]})},D.key)})})]}),t("div",{id:"tour-terminal",role:"tabpanel",className:"hidden lg:block",onFocus:()=>T(!0),onBlur:K,children:[e("div",{onMouseEnter:()=>T(!0),onMouseLeave:K,children:e(Nt,{step:ee,playing:p,paused:P,instant:d||!p&&m===0,onDone:()=>J.current?Z.current=!0:V(m+1)},`${m}-${j}`)}),t("div",{className:"mt-3 flex items-center justify-between text-[12px] text-fg-faint",children:[t("span",{children:["Output abridged from Bun v",E,". Hover to pause."]}),t("div",{className:"flex items-center gap-1",children:[e("button",{type:"button",onClick:()=>V(m-1),"aria-label":"Previous step",className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-line hover:bg-subtle hover:text-fg",children:"â¹"}),e("button",{type:"button",onClick:()=>V(m),"aria-label":"Replay step",className:"inline-flex h-7 items-center justify-center rounded-full border border-line px-2.5 hover:bg-subtle hover:text-fg",children:"replay"}),e("button",{type:"button",onClick:()=>V(m+1),"aria-label":"Next step",className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-line hover:bg-subtle hover:text-fg",children:"âº"})]})]})]})]})})})}function St(d){return 350+d.cmd.length*ke+280+(d.lines[d.lines.length-1]?.t??0)+(d.hold??Qe)}var Se={version:"1.4.2",href:"/blog/bun-v1.4.2",date:"September 2026",kicker:"Latest release",title:"Elysia regression fixed. Upgraded JavaScriptCore. CMYK JPEGs in Bun.Image.",lede:"Bun 1.4.2 fixes 7 issues, including two v1.4.1 regressions: a bun build rename bug impacting Elysia apps and an AsyncLocalStorage memory leak. It also fixes worker_threads 'online' ordering, GC and JIT crashes, CMYK JPEG decoding in Bun.Image and a bun install lockfile panic, and upgrades JavaScriptCore.",highlights:[{text:"Upgraded JavaScriptCore with Intl and TypedArray fixes and cheaper Date objects",href:"/blog/bun-v1.4.2"},{code:"bun build",text:"no longer renames a var onto a let in the same block (v1.4.1 regression that broke Elysia)",href:"/docs/bundler"},{code:"AsyncLocalStorage",text:"exit() and nested run() no longer retain the outer store",href:"/docs/runtime/nodejs-compat"},{code:"worker_threads",text:"'online' arrives before the worker's first messages, unblocking @discordjs/ws",href:"/docs/runtime/workers"},{text:"Fixed a rare JIT crash in long-running processes and a GC crash on musl",href:"/blog/bun-v1.4.2"},{code:"Bun.Image",text:"decodes CMYK and YCCK JPEGs",href:"/docs/runtime/image"},{code:".json()",text:"rejects invalid JSON with the same SyntaxError as JSON.parse",href:"/docs/runtime/web-apis"},{code:"bun install",text:"no longer panics on a lockfile with a mismatched package-name hash",href:"/docs/pm/cli
1/install"}]};function nt({apiTabs:d}){return t(o,{children:[e(He,{releaseHref:Se.href}),e(De,{}),e(Xe,{}),e(Ge,{data:Se}),e(Oe,{}),e(se,{compact:!0}),e(Me,{}),e(ze,{tabs:d}),e(Je,{}),e(Ve,{}),e(Ue,{}),e(Ye,{})]})}var kt={current:"home",ask:!1,banner:{href:"/blog/bun-joins-anthropic",content:e(o,{children:"Bun has joined Anthropic â and Anthropic is betting on Bun"})}}; 2export{nt,kt,Pe};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.