aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-landing/public/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'packages/bun-landing/public/index.html')
-rw-r--r--packages/bun-landing/public/index.html180
1 files changed, 48 insertions, 132 deletions
diff --git a/packages/bun-landing/public/index.html b/packages/bun-landing/public/index.html
index 453104c92..0af23bb40 100644
--- a/packages/bun-landing/public/index.html
+++ b/packages/bun-landing/public/index.html
@@ -1,11 +1,7 @@
-<!DOCTYPE html><html><head><meta charSet="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:title" content="Bun is a fast all-in-one JavaScript runtime"/><meta property="og:description" content="Bundle, transpile, install and run JavaScript &amp; TypeScript
-
+<!DOCTYPE html><html lang="en"><head><meta charSet="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:title" content="Bun is a fast all-in-one JavaScript runtime"/><meta property="og:description" content="Bundle, transpile, install and run JavaScript &amp; TypeScript
projects – all in Bun. Bun is a new JavaScript runtime with
-
a native bundler, transpiler, task runner and npm client built-in."/><meta name="og:locale" content="en_US"/><meta name="twitter:site" content="@jarredsumner"/><meta name="description" content="Bundle, transpile, install and run JavaScript &amp; TypeScript
-
projects – all in Bun. Bun is a new JavaScript runtime with
-
a native bundler, transpiler, task runner and npm client built-in."/><meta name="theme-color" content="#fbf0df"/><link rel="manifest" href="manifest.json"/><link rel="icon" type="image/png" sizes="256x256" href="/logo-square.png"/><link rel="icon" type="image/png" sizes="32x32" href="/logo-square@32px.png"/><link rel="icon" type="image/png" sizes="16x16" href="/logo-square@16px.png"/><title>Bun is a fast all-in-one JavaScript runtime</title><style>:root {
--black: #0b0a08;
--blue: #00a6e1;
@@ -111,7 +107,7 @@ header {
font-size: 1.2rem;
}
-nav {
+.Navigation ul {
white-space: nowrap;
display: flex;
gap: 2rem;
@@ -170,27 +166,24 @@ header {
background: #15140e;
padding: 24px 24px;
border-radius: 24px;
+ user-select: none;
+ -webkit-user-select: none;
+ -webkit-user-drag: none;
+ -moz-user-select: none;
}
-#install-label-heading {
+.InstallBox-label-heading {
font-size: 1.4rem;
margin-bottom: 1rem;
font-weight: 500;
font-weight: 500;
}
-#install-label-subtitle {
+.InstallBox-label-subtitle {
font-size: 0.9rem;
color: var(--orange-light);
}
-.unselectable {
- user-select: none;
- -webkit-user-select: none;
- -webkit-user-drag: none;
- -moz-user-select: none;
-}
-
#usecases-section {
background: linear-gradient(12deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2)),
conic-gradient(
@@ -234,7 +227,7 @@ header {
padding: 0;
}
-#code-box {
+.InstallBox-code-box {
background-color: rgb(37, 36, 32);
padding: 4px 16px;
position: relative;
@@ -251,12 +244,18 @@ header {
font-family: var(--monospace-font);
}
-#curl:hover {
- cursor: text;
+.InstallBox-curl {
+ user-select: all;
+ -webkit-user-select: text;
pointer-events: auto;
+ white-space: nowrap;
+ cursor: text;
+ display: inline-flex;
+ padding: 12px 8px;
+ gap: 2ch;
}
-#curl::before {
+.InstallBox-curl::before {
display: block;
content: "$" / "";
color: var(--orange);
@@ -265,22 +264,11 @@ header {
height: 1ch;
}
-#curl {
- user-select: all;
- -webkit-user-select: text;
- pointer-events: auto;
- white-space: nowrap;
- cursor: text;
- display: inline-flex;
- padding: 12px 8px;
- gap: 2ch;
-}
-
-#view-source-link {
+.InstallBox-view-source-link {
color: var(--orange-light);
}
-#code-box-copy {
+.InstallBox-copy {
height: 100%;
display: flex;
align-items: center;
@@ -295,12 +283,12 @@ header {
font-family: inherit;
}
-#code-box-copy:hover {
+.InstallBox-copy:hover {
color: var(--blue);
transform: scale(1.06);
}
-#code-box-copy:active {
+.InstallBox-copy:active {
transform: scale(1.12);
}
@@ -313,36 +301,26 @@ header {
align-items: center;
width: min-content;
white-space: nowrap;
- list-style-type: none;
padding: 0;
}
.Tab {
width: min-content;
+ border: none;
+ background-color: transparent;
font-family: var(--monospace-font);
text-align: center;
- padding-bottom: 8px;
border-bottom: 1px solid #ccc;
cursor: pointer;
- padding: 0;
-}
-
-.TabButton {
- background: transparent;
- border: none;
- padding: 16px 16px;
+ padding: 16px;
color: inherit;
font-size: inherit;
- font-family: inherit;
- cursor: inherit;
}
-.TabButton[data-tab="react"]:hover,
-.Graphs--active-react .TabButton[data-tab="react"],
-.TabButton[data-tab="sqlite"]:hover,
-.Graphs--active-sqlite .TabButton[data-tab="sqlite"],
-.TabButton[data-tab="ffi"]:hover,
-.Graphs--active-ffi .TabButton[data-tab="ffi"] {
+.Tab:hover,
+.Graphs--active-react .Tab[data-tab="react"],
+.Graphs--active-sqlite .Tab[data-tab="sqlite"],
+.Graphs--active-ffi .Tab[data-tab="ffi"] {
border-bottom-color: aquamarine;
background-color: rgba(130, 216, 247, 0.1);
border-right-color: aquamarine;
@@ -572,16 +550,12 @@ header {
background-color: var(--background);
border-radius: 8px;
padding: 3px 8px;
- color: white;
+ color: black;
text-decoration: none !important;
display: inline-block;
font-family: var(--monospace-font) !important;
}
-.Tag:visited {
- color: white;
-}
-
.mono {
font-family: var(--monospace-font);
}
@@ -605,7 +579,6 @@ header {
.Tag--WebAPI {
--background: #29b6f6;
- color: white;
box-shadow: inset -1px -1px 3px rgb(231, 187, 73);
}
@@ -615,6 +588,7 @@ header {
.Tag--TypeScript {
--background: rgb(69, 119, 192);
+ color: white;
}
.Tag--React {
@@ -633,7 +607,8 @@ header {
}
.Tag--Bun {
- --background: #ff17ff;
+ --background: #e600e5;
+ color: white;
}
.mono {
@@ -709,7 +684,7 @@ header {
gap: 1rem;
}
- #install {
+ .InstallBox {
margin-top: 0;
}
@@ -728,11 +703,11 @@ header {
}
@media (max-width: 599px) {
- #code-box-copy {
+ .InstallBox-copy {
display: none;
}
- #code-box {
+ .InstallBox-code-box {
font-size: 0.8rem;
}
}
@@ -809,7 +784,7 @@ header {
}
@media (max-width: 929px) {
- #code-box {
+ .InstallBox-code-box {
width: fit-content;
}
@@ -874,11 +849,6 @@ header {
border-bottom-color: #333;
}
- .TabButton {
- padding-top: 16px;
- padding-bottom: 16px;
- }
-
#pitch-content {
max-width: 100%;
}
@@ -947,118 +917,64 @@ img {
white-space: nowrap;
width: 1px;
}
-</style></head><body><div id="header-wrap"><header><a href="/" id="logo-link" aria-label="home"><img height="61px" src="/logo.svg" alt="Bun logo" id="logo"/><img height="31.65px" src="/Bun.png" srcSet="/Bun.png 1x, /Bun@2x.png 2x" alt="Bun" id="logo-text"/></a><nav class="Navigation"><li><a class="NavText" href="https://github.com/oven-sh/bun#Reference">Docs</a></li><li><a class="NavText" href="https://bun.sh/discord">Discord</a></li><li><a class="NavText" href="https://github.com/oven-sh/bun">GitHub</a></li></nav></header></div><div id="pitch"><main><div id="pitch-content"><h1 class="tagline">Bun is a fast all-in-one JavaScript runtime</h1><p class="subtitle">Bundle, transpile, install and run JavaScript &amp; TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.</p><div class="InstallBox InstallBox--desktop" id="install"><div id="install-label"><div class="unselectable" id="install-label-heading">Install Bun CLI v0.1.0 (beta)</div><div class="unselectable" id="install-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div id="code-box"><div id="curl">curl https://bun.sh/install | bash</div><button class="unselectable" id="code-box-copy" aria-label="Copy installation script">copy</button></div><a class="unselectable" id="view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></div><div class="Graphs Graphs--active-react"><ul class="Tabs" role="tablist"><li class="Tab"><button data-tab="react" id="tab-react" aria-controls="react-tab-content" class="TabButton" role="tab" aria-selected="true" tabindex="0">Bun.serve</button></li><li class="Tab"><button data-tab="sqlite" id="tab-sqlite" aria-controls="sqlite-tab-content" class="TabButton" role="tab" tabindex="-1">bun:sqlite</button></li><li class="Tab"><button data-tab="ffi" id="tab-ffi" aria-controls="ffi-tab-content" class="TabButton" role="tab" tabindex="-1">bun:ffi</button></li></ul><div id="active-tab" class="ActiveTab"><div role="tabpanel" tabindex="0" id="react-tab-content" aria-labelledby="tab-react" class="BarGraph BarGraph--react BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">Server-side rendering React</h2><p class="BarGraph-subheading">HTTP requests per second (Linux AMD64)</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:48936;--max:61170"><div class="visually-hidden">bun: 48,936 requests per second</div><div style="--amount:48936;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:48936;--max:61170" class="BarGraphBar-label">48,936</div></div></li><li class="BarGraphItem BarGraphItem--node" style="--amount:16288;--max:61170"><div class="visually-hidden">node: 16,288 requests per second</div><div style="--amount:16288;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:16288;--max:61170" class="BarGraphBar-label">16,288</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:15786;--max:61170"><div class="visually-hidden">deno: 15,786 requests per second</div><div style="--amount:15786;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:15786;--max:61170" class="BarGraphBar-label">15,786</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/bench/react-hello-world.jsx" target="_blank" class="BarGraphKeyItem" aria-label="bun benchmark source"><div class="BarGraphKeyItem-label">bun</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/bench/react-hello-world.node.jsx" target="_blank" class="BarGraphKeyItem" aria-label="node benchmark source"><div class="BarGraphKeyItem-label">node</div><div class="BarGraphKeyItem-value">v18.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/bench/react-hello-world.deno.jsx" target="_blank" class="BarGraphKeyItem" aria-label="deno benchmark source"><div class="BarGraphKeyItem-label">deno</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div role="tabpanel" tabindex="-1" id="sqlite-tab-content" aria-labelledby="tab-sqlite" class="BarGraph--sqlite BarGraph BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">Load a huge table</h2><p class="BarGraph-subheading">Average queries per second</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:60.24;--max:76"><div class="visually-hidden">bun: 60.24 queries per second</div><div style="--amount:60.24;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:60.24;--max:76" class="BarGraphBar-label">60.24</div></div></li><li class="BarGraphItem BarGraphItem--better-sqlite3" style="--amount:23.28;--max:76"><div class="visually-hidden">better-sqlite3: 23.28 queries per second</div><div style="--amount:23.28;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:23.28;--max:76" class="BarGraphBar-label">23.28</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:9.55;--max:76"><div class="visually-hidden">deno: 9.55 queries per second</div><div style="--amount:9.55;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:9.55;--max:76" class="BarGraphBar-label">9.55</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.js" target="_blank" class="BarGraphKeyItem" aria-label="bun:sqlite benchmark source"><div class="BarGraphKeyItem-label">bun:sqlite</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.better-sqlite3.mjs" target="_blank" class="BarGraphKeyItem" aria-label="better-sqlite3 benchmark source"><div class="BarGraphKeyItem-label">better-sqlite3</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.deno.js" target="_blank" class="BarGraphKeyItem" aria-label="deno (x/sqlite) benchmark source"><div class="BarGraphKeyItem-label">deno (x/sqlite)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div role="tabpanel" tabindex="-1" id="ffi-tab-content" aria-labelledby="tab-ffi" class="BarGraph BarGraph--ffi BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">How fast can it get?</h2><p class="BarGraph-subheading">Operations per second</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:115473441.00;--max:144341802"><div class="visually-hidden">bun: 115,473,441 operations per second</div><div style="--amount:115473441.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:115473441.00;--max:144341802" class="BarGraphBar-label">115,473,441</div></div></li><li class="BarGraphItem BarGraphItem--Node-API" style="--amount:43478261.00;--max:144341802"><div class="visually-hidden">Node-API: 43,478,261 operations per second</div><div style="--amount:43478261.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:43478261.00;--max:144341802" class="BarGraphBar-label">43,478,261</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:2891761.00;--max:144341802"><div class="visually-hidden">deno: 2,891,761 operations per iteration</div><div style="--amount:2891761.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:2891761.00;--max:144341802" class="BarGraphBar-label">2,891,761</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.bun.js" target="_blank" class="BarGraphKeyItem" aria-label="bun:ffi benchmark source"><div class="BarGraphKeyItem-label">bun:ffi</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.napi.mjs" target="_blank" class="BarGraphKeyItem" aria-label="node (napi) benchmark source"><div class="BarGraphKeyItem-label">node (napi)</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.deno.js" target="_blank" class="BarGraphKeyItem" aria-label="deno (ffi) benchmark source"><div class="BarGraphKeyItem-label">deno (ffi)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div></div></div><div class="InstallBox InstallBox--mobile" id="install"><div id="install-label"><div class="unselectable" id="install-label-heading">Install Bun CLI v0.1.0 (beta)</div><div class="unselectable" id="install-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div id="code-box"><div id="curl">curl https://bun.sh/install | bash</div><button class="unselectable" id="code-box-copy" aria-label="Copy installation script">copy</button></div><a class="unselectable" id="view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></main></div><section id="explain-section"><div id="explain"><h2>Tell me more about Bun</h2><p>Bun is a modern JavaScript runtime like Node or Deno. It was built from scratch to focus on three main things:</p><ul><li>Start fast (it has the edge in mind).</li><li>New levels of performance (extending JavaScriptCore, the engine).</li><li>Being a great and complete tool (bundler, transpiler, package manager).</li></ul><p>Bun is designed as a drop-in replacement for your current JavaScript &amp; TypeScript apps or scripts — on your local computer, server or on the edge. Bun natively implements hundreds of Node.js and Web APIs, including ~90% of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html" target="_blank">Node-API</a> <!-- -->functions (native modules), fs, path, Buffer and more.<!-- --></p><p>The goal of Bun is to run most of the worlds JavaScript outside of browsers, bringing performance and complexity enhancements to your future infrastructure, as well as developer productivity through better, simpler tooling.</p><h2>Batteries included</h2><ul id="batteries"><li>Web APIs like<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/fetch" class="Tag Tag--WebAPI">fetch</a>,<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket" class="Tag Tag--WebAPI">WebSocket</a>, and<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream" class="Tag Tag--WebAPI">ReadableStream</a> <!-- -->are builtin<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node_modules</span> bun implements Node.js&#x27; module resolution algorithm, so you can use npm packages in bun.js. ESM and CommonJS are supported, but Bun internally uses ESM.<!-- --></li><li>In bun.js, every file is transpiled.<!-- --> <!-- --><span target="_blank" class="Tag Tag--TypeScript">TypeScript</span> &amp; <!-- --><span target="_blank" class="Tag Tag--React">JSX</span> just work.<!-- --></li><li>bun supports <!-- --><code class="">&quot;paths&quot;</code>,<!-- --> <!-- --><code>&quot;jsxImportSource&quot;</code>and more from <!-- --><span target="_blank" class="Tag Tag--TypeScript">tsconfig.json</span> files<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">Bun.Transpiler</span> bun&#x27;s JSX &amp; TypeScript transpiler is available as an API in Bun.js<!-- --></li><li>use the fastest system calls available with <!-- --><span target="_blank" class="Tag Tag--Bun">Bun.write</span> <!-- -->to write, copy, pipe, send and clone files.<!-- --></li><li>bun.js automatically loads environment variables from<!-- --> <!-- --><span target="_blank" class="Tag Tag--Bun">.env</span> files. No more<!-- --> <!-- --><code class="mono">require(&quot;dotenv&quot;).load()</code></li><li>bun ships with a fast SQLite3 client builtin <!-- --><span target="_blank" class="Tag Tag--Bun">bun:sqlite</span></li><li><a target="_blank" href="https://github.com/oven-sh/bun/issues/158" class="Tag Tag--NodeJS">Node-API</a> <!-- -->bun.js implements most of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html#node-api" target="_blank">Node-API (N-API)</a>. Many Node.js native modules just work.<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">bun:ffi</span> call native code from JavaScript with bun&#x27;s low-overhead foreign function interface<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node:fs</span> <!-- --><span target="_blank" class="Tag Tag--NodeJS">node:path</span> bun.js natively supports a growing list of Node.js core modules along with globals like Buffer and process.<!-- --></li></ul><h2>How does Bun work?</h2><p>Bun.js uses the<!-- --> <!-- --><a href="https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore">JavaScriptCore</a> <!-- -->engine, which tends<!-- --> <!-- --><a target="blank" href="https://twitter.com/jarredsumner/status/1499225725492076544">to start</a> <!-- -->and perform a little faster than more traditional choices like V8. Bun is written in<!-- --> <!-- --><a href="https://ziglang.org/"><svg xmlns="http://www.w3.org/2000/svg" height="1.2rem" class="Zig" viewBox="0 0 400 140"><title>Zig</title><g fill="#F7A41D"><g><polygon points="46,22 28,44 19,30"></polygon><polygon points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22" shape-rendering="crispEdges"></polygon><polygon points="31,95 12,117 4,106"></polygon></g><g><polygon points="56,22 62,36 37,44"></polygon><polygon points="56,22 111,22 111,44 37,44 56,32" shape-rendering="crispEdges"></polygon><polygon points="116,95 97,117 90,104"></polygon><polygon points="116,95 100,104 97,117 42,117 42,95" shape-rendering="crispEdges"></polygon><polygon points="150,0 52,117 3,140 101,22"></polygon></g><g><polygon points="141,22 140,40 122,45"></polygon><polygon points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22" shape-rendering="crispEdges"></polygon><polygon points="125,95 130,110 106,117"></polygon></g></g><g fill="#121212"><g><polygon points="260,22 260,37 229,40 177,40 177,22" shape-rendering="crispEdges"></polygon><polygon points="260,37 207,99 207,103 176,103 229,40 229,37"></polygon><polygon points="261,99 261,117 176,117 176,103 206,99" shape-rendering="crispEdges"></polygon></g><rect x="272" y="22" shape-rendering="crispEdges" width="22" height="95"></rect><g><polygon points="394,67 394,106 376,106 376,81 360,70 346,67" shape-rendering="crispEdges"></polygon><polygon points="360,68 376,81 346,67"></polygon><path d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
+</style></head><body><div id="header-wrap"><header><a href="/" id="logo-link" aria-label="home"><img height="61px" src="/logo.svg" alt="Bun logo" id="logo"/><img height="31.65px" src="/Bun.png" srcSet="/Bun.png 1x, /Bun@2x.png 2x" alt="Bun" id="logo-text"/></a><nav class="Navigation"><ul><li><a class="NavText" href="https://github.com/oven-sh/bun#Reference">Docs</a></li><li><a class="NavText" href="https://bun.sh/discord">Discord</a></li><li><a class="NavText" href="https://github.com/oven-sh/bun">GitHub</a></li></ul></nav></header></div><div id="pitch"><main><div id="pitch-content"><h1 class="tagline">Bun is a fast all-in-one JavaScript runtime</h1><p class="subtitle">Bundle, transpile, install and run JavaScript &amp; TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.</p><div class="InstallBox InstallBox--desktop"><div class="InstallBox-label"><div class="InstallBox-label-heading">Install Bun CLI v<!-- -->v0.1.3<!-- --> (beta)<!-- --></div><div class="InstallBox-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div class="InstallBox-code-box"><div class="InstallBox-curl">curl https://bun.sh/install | bash</div><button class="InstallBox-copy" aria-label="Copy installation script">copy</button></div><a class="InstallBox-view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></div><div class="Graphs Graphs--active-react"><div class="Tabs" role="tablist"><button data-tab="react" id="tab-react" aria-controls="react-tab-content" class="Tab" role="tab" aria-selected="true" tabindex="0">Bun.serve</button><button data-tab="sqlite" id="tab-sqlite" aria-controls="sqlite-tab-content" class="Tab" role="tab" tabindex="-1">bun:sqlite</button><button data-tab="ffi" id="tab-ffi" aria-controls="ffi-tab-content" class="Tab" role="tab" tabindex="-1">bun:ffi</button></div><div id="active-tab" class="ActiveTab"><div role="tabpanel" tabindex="0" id="react-tab-content" aria-labelledby="tab-react" class="BarGraph BarGraph--react BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">Server-side rendering React</h2><p class="BarGraph-subheading">HTTP requests per second (Linux AMD64)</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:48936;--max:61170"><div class="visually-hidden">bun: 48,936 requests per second</div><div style="--amount:48936;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:48936;--max:61170" class="BarGraphBar-label">48,936</div></div></li><li class="BarGraphItem BarGraphItem--node" style="--amount:16288;--max:61170"><div class="visually-hidden">node: 16,288 requests per second</div><div style="--amount:16288;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:16288;--max:61170" class="BarGraphBar-label">16,288</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:15786;--max:61170"><div class="visually-hidden">deno: 15,786 requests per second</div><div style="--amount:15786;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:15786;--max:61170" class="BarGraphBar-label">15,786</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/blob/main/bench/react-hello-world.jsx" target="_blank" class="BarGraphKeyItem" aria-label="bun benchmark source"><div class="BarGraphKeyItem-label">bun</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/react-hello-world.node.jsx" target="_blank" class="BarGraphKeyItem" aria-label="node benchmark source"><div class="BarGraphKeyItem-label">node</div><div class="BarGraphKeyItem-value">v18.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/react-hello-world.deno.jsx" target="_blank" class="BarGraphKeyItem" aria-label="deno benchmark source"><div class="BarGraphKeyItem-label">deno</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div role="tabpanel" tabindex="-1" id="sqlite-tab-content" aria-labelledby="tab-sqlite" class="BarGraph--sqlite BarGraph BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">Load a huge table</h2><p class="BarGraph-subheading">Average queries per second</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:60.24;--max:76"><div class="visually-hidden">bun: 60.24 queries per second</div><div style="--amount:60.24;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:60.24;--max:76" class="BarGraphBar-label">60.24</div></div></li><li class="BarGraphItem BarGraphItem--better-sqlite3" style="--amount:23.28;--max:76"><div class="visually-hidden">better-sqlite3: 23.28 queries per second</div><div style="--amount:23.28;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:23.28;--max:76" class="BarGraphBar-label">23.28</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:9.55;--max:76"><div class="visually-hidden">deno: 9.55 queries per second</div><div style="--amount:9.55;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:9.55;--max:76" class="BarGraphBar-label">9.55</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.js" target="_blank" class="BarGraphKeyItem" aria-label="bun:sqlite benchmark source"><div class="BarGraphKeyItem-label">bun:sqlite</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.better-sqlite3.mjs" target="_blank" class="BarGraphKeyItem" aria-label="better-sqlite3 benchmark source"><div class="BarGraphKeyItem-label">better-sqlite3</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.deno.js" target="_blank" class="BarGraphKeyItem" aria-label="deno (x/sqlite) benchmark source"><div class="BarGraphKeyItem-label">deno (x/sqlite)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div role="tabpanel" tabindex="-1" id="ffi-tab-content" aria-labelledby="tab-ffi" class="BarGraph BarGraph--ffi BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">How fast can it get?</h2><p class="BarGraph-subheading">Operations per second</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:115473441.00;--max:144341802"><div class="visually-hidden">bun: 115,473,441 operations per second</div><div style="--amount:115473441.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:115473441.00;--max:144341802" class="BarGraphBar-label">115,473,441</div></div></li><li class="BarGraphItem BarGraphItem--Node-API" style="--amount:43478261.00;--max:144341802"><div class="visually-hidden">Node-API: 43,478,261 operations per second</div><div style="--amount:43478261.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:43478261.00;--max:144341802" class="BarGraphBar-label">43,478,261</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:2891761.00;--max:144341802"><div class="visually-hidden">deno: 2,891,761 operations per iteration</div><div style="--amount:2891761.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:2891761.00;--max:144341802" class="BarGraphBar-label">2,891,761</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.bun.js" target="_blank" class="BarGraphKeyItem" aria-label="bun:ffi benchmark source"><div class="BarGraphKeyItem-label">bun:ffi</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.napi.mjs" target="_blank" class="BarGraphKeyItem" aria-label="node (napi) benchmark source"><div class="BarGraphKeyItem-label">node (napi)</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.deno.js" target="_blank" class="BarGraphKeyItem" aria-label="deno (ffi) benchmark source"><div class="BarGraphKeyItem-label">deno (ffi)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div></div></div><div class="InstallBox InstallBox--mobile"><div class="InstallBox-label"><div class="InstallBox-label-heading">Install Bun CLI v<!-- -->v0.1.3<!-- --> (beta)<!-- --></div><div class="InstallBox-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div class="InstallBox-code-box"><div class="InstallBox-curl">curl https://bun.sh/install | bash</div><button class="InstallBox-copy" aria-label="Copy installation script">copy</button></div><a class="InstallBox-view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></main></div><section id="explain-section"><div id="explain"><h2>Tell me more about Bun</h2><p>Bun is a modern JavaScript runtime like Node or Deno. It was built from scratch to focus on three main things:</p><ul><li>Start fast (it has the edge in mind).</li><li>New levels of performance (extending JavaScriptCore, the engine).</li><li>Being a great and complete tool (bundler, transpiler, package manager).</li></ul><p>Bun is designed as a drop-in replacement for your current JavaScript &amp; TypeScript apps or scripts — on your local computer, server or on the edge. Bun natively implements hundreds of Node.js and Web APIs, including ~90% of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html" target="_blank">Node-API</a> <!-- -->functions (native modules), fs, path, Buffer and more.<!-- --></p><p>The goal of Bun is to run most of the worlds JavaScript outside of browsers, bringing performance and complexity enhancements to your future infrastructure, as well as developer productivity through better, simpler tooling.</p><h2>Batteries included</h2><ul id="batteries"><li>Web APIs like<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/fetch" class="Tag Tag--WebAPI">fetch</a>,<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket" class="Tag Tag--WebAPI">WebSocket</a>, and<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream" class="Tag Tag--WebAPI">ReadableStream</a> <!-- -->are builtin<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node_modules</span> bun implements Node.js&#x27; module resolution algorithm, so you can use npm packages in bun.js. ESM and CommonJS are supported, but Bun internally uses ESM.<!-- --></li><li>In bun.js, every file is transpiled.<!-- --> <!-- --><span target="_blank" class="Tag Tag--TypeScript">TypeScript</span> &amp; <!-- --><span target="_blank" class="Tag Tag--React">JSX</span> just work.<!-- --></li><li>bun supports <!-- --><code class="">&quot;paths&quot;</code>,<!-- --> <!-- --><code>&quot;jsxImportSource&quot;</code>and more from <!-- --><span target="_blank" class="Tag Tag--TypeScript">tsconfig.json</span> files<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">Bun.Transpiler</span> bun&#x27;s JSX &amp; TypeScript transpiler is available as an API in Bun.js<!-- --></li><li>use the fastest system calls available with <!-- --><span target="_blank" class="Tag Tag--Bun">Bun.write</span> <!-- -->to write, copy, pipe, send and clone files.<!-- --></li><li>bun.js automatically loads environment variables from<!-- --> <!-- --><span target="_blank" class="Tag Tag--Bun">.env</span> files. No more<!-- --> <!-- --><code class="mono">require(&quot;dotenv&quot;).config()</code></li><li>bun ships with a fast SQLite3 client builtin <!-- --><span target="_blank" class="Tag Tag--Bun">bun:sqlite</span></li><li><a target="_blank" href="https://github.com/oven-sh/bun/issues/158" class="Tag Tag--NodeJS">Node-API</a> <!-- -->bun.js implements most of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html#node-api" target="_blank">Node-API (N-API)</a>. Many Node.js native modules just work.<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">bun:ffi</span> call native code from JavaScript with bun&#x27;s low-overhead foreign function interface<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node:fs</span> <!-- --><span target="_blank" class="Tag Tag--NodeJS">node:path</span> bun.js natively supports a growing list of Node.js core modules along with globals like Buffer and process.<!-- --></li></ul><h2>How does Bun work?</h2><p>Bun.js uses the<!-- --> <!-- --><a href="https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore">JavaScriptCore</a> <!-- -->engine, which tends<!-- --> <!-- --><a target="blank" href="https://twitter.com/jarredsumner/status/1499225725492076544">to start</a> <!-- -->and perform a little faster than more traditional choices like V8. Bun is written in<!-- --> <!-- --><a href="https://ziglang.org/"><svg xmlns="http://www.w3.org/2000/svg" height="1.2rem" class="Zig" viewBox="0 0 400 140"><title>Zig</title><g fill="#F7A41D"><g><polygon points="46,22 28,44 19,30"></polygon><polygon points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22" shape-rendering="crispEdges"></polygon><polygon points="31,95 12,117 4,106"></polygon></g><g><polygon points="56,22 62,36 37,44"></polygon><polygon points="56,22 111,22 111,44 37,44 56,32" shape-rendering="crispEdges"></polygon><polygon points="116,95 97,117 90,104"></polygon><polygon points="116,95 100,104 97,117 42,117 42,95" shape-rendering="crispEdges"></polygon><polygon points="150,0 52,117 3,140 101,22"></polygon></g><g><polygon points="141,22 140,40 122,45"></polygon><polygon points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22" shape-rendering="crispEdges"></polygon><polygon points="125,95 130,110 106,117"></polygon></g></g><g fill="#121212"><g><polygon points="260,22 260,37 229,40 177,40 177,22" shape-rendering="crispEdges"></polygon><polygon points="260,37 207,99 207,103 176,103 229,40 229,37"></polygon><polygon points="261,99 261,117 176,117 176,103 206,99" shape-rendering="crispEdges"></polygon></g><rect x="272" y="22" shape-rendering="crispEdges" width="22" height="95"></rect><g><polygon points="394,67 394,106 376,106 376,81 360,70 346,67" shape-rendering="crispEdges"></polygon><polygon points="360,68 376,81 346,67"></polygon><path d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
c14.3,0,29.2,5.5,38.9,14l-13,15c-7.1-6.3-16.8-10-25.9-10c-17,0-30.2,12.9-30.2,29.5c0,16.8,13.3,29.6,30.3,29.6
c5.7,0,12.8-2.3,19-5.5L394,106z"></path></g></g></svg></a>, a low-level programming language with manual memory management.<!-- --><br/><br/>Most of Bun is written from scratch including the JSX/TypeScript transpiler, npm client, bundler, SQLite client, HTTP client, WebSocket client and more.<!-- --></p><h2>Why is Bun fast?</h2><p>An enormous amount of time spent profiling, benchmarking and optimizing things. The answer is different for every part of Bun, but one general theme:<!-- --> <!-- --><a href="https://ziglang.org/"><svg xmlns="http://www.w3.org/2000/svg" height="1.2rem" class="Zig" viewBox="0 0 400 140"><title>Zig</title><g fill="#F7A41D"><g><polygon points="46,22 28,44 19,30"></polygon><polygon points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22" shape-rendering="crispEdges"></polygon><polygon points="31,95 12,117 4,106"></polygon></g><g><polygon points="56,22 62,36 37,44"></polygon><polygon points="56,22 111,22 111,44 37,44 56,32" shape-rendering="crispEdges"></polygon><polygon points="116,95 97,117 90,104"></polygon><polygon points="116,95 100,104 97,117 42,117 42,95" shape-rendering="crispEdges"></polygon><polygon points="150,0 52,117 3,140 101,22"></polygon></g><g><polygon points="141,22 140,40 122,45"></polygon><polygon points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22" shape-rendering="crispEdges"></polygon><polygon points="125,95 130,110 106,117"></polygon></g></g><g fill="#121212"><g><polygon points="260,22 260,37 229,40 177,40 177,22" shape-rendering="crispEdges"></polygon><polygon points="260,37 207,99 207,103 176,103 229,40 229,37"></polygon><polygon points="261,99 261,117 176,117 176,103 206,99" shape-rendering="crispEdges"></polygon></g><rect x="272" y="22" shape-rendering="crispEdges" width="22" height="95"></rect><g><polygon points="394,67 394,106 376,106 376,81 360,70 346,67" shape-rendering="crispEdges"></polygon><polygon points="360,68 376,81 346,67"></polygon><path d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
c14.3,0,29.2,5.5,38.9,14l-13,15c-7.1-6.3-16.8-10-25.9-10c-17,0-30.2,12.9-30.2,29.5c0,16.8,13.3,29.6,30.3,29.6
c5.7,0,12.8-2.3,19-5.5L394,106z"></path></g></g></svg></a>&#x27;s low-level control over memory and lack of hidden control flow makes it much simpler to write fast software.<!-- --> <!-- --><a href="https://github.com/sponsors/ziglang">Sponsor the Zig Software Foundation</a></p><h2>Getting started</h2><p>To install bun, run this<!-- --> <!-- --><a target="_blank" href="https://bun.sh/install">install script</a> <!-- -->in your terminal. It downloads Bun from GitHub.<!-- --></p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #F8F8F2">curl https://bun.sh/install </span><span style="color: #FF79C6">|</span><span style="color: #F8F8F2"> bash</span></span></code></pre></div><p> <!-- -->Bun&#x27;s HTTP server is built on web standards like<!-- --> <!-- --><a class="Identifier" href="https://developer.mozilla.org/en-US/docs/Web/API/Request">Request</a> <!-- -->and<!-- --> <!-- --><a class="Identifier" href="https://developer.mozilla.org/en-US/docs/Web/API/Response">Response</a></p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #6272A4">// http.js</span></span>
-<span class="line"></span>
<span class="line"><span style="color: #FF79C6">export</span><span style="color: #F8F8F2"> </span><span style="color: #FF79C6">default</span><span style="color: #F8F8F2"> {</span></span>
-<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> port</span><span style="color: #FF79C6">:</span><span style="color: #F8F8F2"> </span><span style="color: #BD93F9">3000</span><span style="color: #F8F8F2">,</span></span>
-<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> </span><span style="color: #50FA7B">fetch</span><span style="color: #F8F8F2">(</span><span style="color: #FFB86C; font-style: italic">request</span><span style="color: #F8F8F2">) {</span></span>
-<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> </span><span style="color: #FF79C6">return</span><span style="color: #F8F8F2"> </span><span style="color: #FF79C6; font-weight: bold">new</span><span style="color: #F8F8F2"> </span><span style="color: #50FA7B">Response</span><span style="color: #F8F8F2">(</span><span style="color: #E9F284">&quot;</span><span style="color: #F1FA8C">Welcome to Bun!</span><span style="color: #E9F284">&quot;</span><span style="color: #F8F8F2">);</span></span>
-<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> },</span></span>
-<span class="line"></span>
<span class="line"><span style="color: #F8F8F2">};</span></span></code></pre></div><p>Run it with bun:</p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #F8F8F2">bun run http.js</span></span></code></pre></div><p>Then open<!-- --> <!-- --><a target="_blank" href="http://localhost:3000">http://localhost:3000</a> <!-- -->in your browser<!-- --><br/><br/>See<!-- --> <!-- --><a href="https://github.com/oven-sh/bun/tree/main/examples">more examples</a> <!-- -->and check out <!-- --><a href="https://github.com/oven-sh/bun#Reference">the docs</a>. If you have any questions or want help, join<!-- --> <!-- --><a href="https://bun.sh/discord">Bun&#x27;s Discord</a></p><h2>Bun CLI</h2><div class="Group"><span target="_blank" class="Tag Tag--Command">bun run</span><p>The same command for running JavaScript &amp; TypeScript files with bun&#x27;s JavaScript runtime also runs package.json<!-- --> <!-- --><code class="mono">&quot;scripts&quot;</code>.<!-- --></p><strong>Replace <!-- --><code class="mono">npm run</code> with<!-- --> <!-- --><code class="mono">bun run</code> and save 160ms on every run.<!-- --></strong><br/><div>bun runs package.json scripts<!-- --> <!-- --><a href="https://twitter.com/jarredsumner/status/1454218996983623685" target="_blank" class="PerformanceClaim">30x faster than <!-- --><code class="mono">npm run</code></a></div> <!-- --></div><div class="Group"><span target="_blank" class="Tag Tag--Command">bun install</span><p>bun install is an npm-compatible package manager. You probably will be surprised by how much faster copying files can get.</p><strong>Replace <!-- --><code class="mono">yarn</code> with<!-- --> <!-- --><code class="mono">bun install</code> and get 20x faster package installs.<!-- --></strong><br/><div>bun install uses the fastest system calls available to copy files.</div></div><div class="Group"><span target="_blank" class="Tag Tag--Command">bun wiptest</span><p>A Jest-like test runner for JavaScript &amp; TypeScript projects builtin to bun</p><div class="Label"><a href="https://twitter.com/jarredsumner/status/1542824445810642946" target="_blank" class="PerformanceClaim">You&#x27;ve never seen a JavaScript test runner this fast</a> <!-- -->(or incomplete)<!-- --></div></div><h2>What is the license?</h2><p>MIT License, excluding dependencies which have various licenses.</p><h2>How do I see the source code?</h2><p>Bun is on <!-- --><a href="https://github.com/oven-sh/bun">GitHub</a></p></div></section><section id="explain-section"><div id="explain"></div></section><script>
-
-[...document.querySelectorAll(".TabButton")].map(el => {
-
+[...document.querySelectorAll(".Tab")].map(el => {
el.addEventListener("click", function(e) {
-
var tab = e.srcElement.getAttribute("data-tab");
-
- [...document.querySelectorAll(".TabButton")].map(el => {
-
+ [...document.querySelectorAll(".Tab")].map(el => {
var active = el.getAttribute("data-tab") === tab;
-
el.setAttribute("tabindex", active ? 0 : -1);
-
el.setAttribute("aria-selected", active);
-
});
-
[...document.querySelectorAll(".BarGraph")].map(el => {
-
var active = el.id === tab + "-tab-content";
-
el.setAttribute("tabindex", active ? 0 : -1);
-
});
-
document.querySelector(".Graphs").setAttribute("class", "Graphs Graphs--active-" + tab);
-
});
-
-
el.addEventListener("keydown", e => {
-
- var tabs = [...document.querySelectorAll(".TabButton")];
-
- var activeTabEl = document.querySelector(".TabButton[aria-selected='true']");
-
+ var tabs = [...document.querySelectorAll(".Tab")];
+ var activeTabEl = document.querySelector(".Tab[aria-selected='true']");
var activeTabIndex = tabs.indexOf(activeTabEl);
-
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
-
e.preventDefault();
-
activeTabIndex = (activeTabIndex + 1) % tabs.length;
-
tabs[activeTabIndex].click();
-
tabs[activeTabIndex].focus();
-
}
-
if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
-
e.preventDefault();
-
activeTabIndex = (activeTabIndex + tabs.length - 1) % tabs.length;
-
tabs[activeTabIndex].click();
-
tabs[activeTabIndex].focus();
-
}
-
if (e.key === 'Home') {
-
e.preventDefault();
-
tabs[0].click();
-
tabs[0].focus();
-
}
-
if (e.key === 'End') {
-
e.preventDefault();
-
tabs[tabs.length - 1].click();
-
tabs[tabs.length - 1].focus();
-
}
-
});
-
-});
-
-
-
-document.querySelector("#code-box-copy").addEventListener("click", async e => {
-
- var el = document.querySelector("#code-box");
-
- await navigator.clipboard.writeText("curl https://bun.sh/install | bash");
-
});
- </script><div class="Built">Built with Bun <!-- -->v0.1.2<!-- --></div></body></html> \ No newline at end of file
+for (const el of document.querySelectorAll(".InstallBox-copy")) {
+ el.addEventListener("click", async e => {
+ await navigator.clipboard.writeText("curl https://bun.sh/install | bash");
+ });
+}
+ </script><div class="Built">Built with Bun <!-- -->v0.1.3<!-- --></div></body></html> \ No newline at end of file