Bunβs MySQL support was a project I poured significant effort into optimizing. Careful tuning of the pipeline and queue management led to substantial performance gains.
JavaScriptβs Date() has been confusing devs for decades
The new Temporal API finally fixes that, immutable, timezone-aware, precise, and simple to use.
You can already try it in Bun!
Bun.password makes hashing and verifying passwords simple and secure.
The algorithm used to create the hash is stored in the hash itself. When using bcrypt, the returned hash is encoded in Modular Crypt Format for compatibility with most existing bcrypt implementations; with
Bun comes with a built-in bundler, dev server, and hot reload. Zero config. Instant updates.
Run bun ./index.html to start a dev server. TypeScript, JSX, React, and CSS imports work out of the box.
Build optimized bundles with bun build ./index.html --production. Tree-shaking,
postMessage is the most common way to send data between multiple worker threads in JavaScript.
By avoiding serialization for strings we know are safe to share across threads, it's up to 500x faster and uses ~22x less peak memory
Transforming HTML on the fly has never been this easy.
The Bun HTMLRewriter API gives you low-level control to parse, modify, and enhance HTML using CSS selectors, all at incredible speed. Bunβs implementation is based on Cloudflareβs lol-html.
It can rewrite content coming
Bun.redis benchmarks shows it performing up to 7.9x faster while using 2.1x less memory compared to other Redis clients in similar workloads. With corking and pipelining techniques combined make the client highly optimized for high-throughput and low-latency workloads
Bun.SQL uses tagged template literals in this example, which means that it will transform it into a prepared statement protecting against SQL injection and running faster in subsequent runs