Never Worry About CORS Again

Bookmark
Rate this content

Fixing CORS errors is a frustrating rite of passage for every web developer. Bun's Rendering API makes it trivial to run your frontend and API on the same server, eliminating the entire category of cross-origin errors. Developers no longer need to wrestle with complex server-side headers or proxy requests just to fetch data from a different domain.

This talk has been presented at JSNation US 2025, check out the latest edition of this JavaScript Conference.

FAQ

Yes, Bund supports React through built-in JSX support, and it can also work with other frameworks like Preact using plugins.

Bund handles security vulnerabilities by reproducing reported issues and fixing them quickly, following a disclosure process through GitHub.

Bund is an incredibly fast JavaScript runtime that includes a JavaScript runtime, package manager, test runner, and bundler. It aims to improve performance by reducing complexity in JavaScript tooling.

Bund combines four main features: a JavaScript runtime, a package manager, a test runner, and a bundler. It also offers Node.js compatibility, a built-in WebSocket server, support for React, CSS, TypeScript, JSX, and more.

Bund was designed as a drop-in replacement for Node.js, aiming to ensure everything that works in Node.js also works in Bund. If there are compatibility issues, users are encouraged to report them.

Bund includes built-in clients for Redis, MySQL, and Postgres, and offers a consistent API that is similar to existing libraries like Postgres.js and Ioredis.

Bund improves npm installation speed by optimizing common package operations, avoiding unnecessary scripts, and supporting pnpm lockfile migration with a custom YAML parser.

While Bund is being increasingly adopted in production environments by companies like Midjourney and Cloud Code, certain features like worker threads are still unstable, so caution is advised.

To use Bund in an existing project with npm dependencies, you can simply switch your GitHub action from setup-node to setup-bund and run your files using Bund.

Bund was created out of frustration with the slow speed of JavaScript tooling, including package installations and test running. It aims to improve performance by compressing layers in the stack.

Jarred Sumner
Jarred Sumner
28 min
17 Nov, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Talk on Bund: Overview of Bund, its speed optimization, components like runtime, package manager, test runner, and bundler. Efficient features include fast npm manager, pnpm lockfile support, Jest-compatible test runner, and optimized runtime components. Built-in features like modern password hashing, WebSocket server, file glob API, and database clients. API design focuses on common use cases and optimization. Enhanced JavaScript functionality with SIMD, native code, and performance improvements. Challenges in JavaScript productivity, BUN adoption, deployment, and support. React support, community involvement, security, Next.js compatibility, and transition.

1. Understanding Bund Tool

Short description:

Talk on Bund: Overview of Bund, its speed optimization, components like runtime, package manager, test runner, and bundler. Emphasis on Node.js compatibility and bug reporting in Bund's GitHub repo.

Thanks everyone. Yeah, so the rendering API is not ready yet. So I'm going to give a different talk about Bund. Kind of like... First I'm going to give a little overview of what is actually Bund, and kind of where we... Bund's past, present, and also the future. Where Bund kind of started was really frustrated with... For years I'd been really frustrated with how slow everything is in JavaScript tooling. Why does installing your packages take sometimes minutes if you're at a big company? Why does running the test take a long time? Why does every command feel pretty slow, like when you just run a command in your terminal?

And a lot of that is because the complexity of everything... There's a lot of layers in the stack, and so if you compress the layers then you get less stuff and performance improves. So Bund is an incredibly fast JavaScript runtime. It's really four things in one. It's a JavaScript runtime, it's a package manager, it's a test runner, and it's a bundler. And each of these pieces kind of uses the other piece.

So for example, the package manager uses the same JSON parser that the runtime uses, which is also used by the bundler. The bundler at runtime, we transpile every single file. And so that uses the same stuff from the bundler. And this transpiler in Bund was built for Bund specifically. It's not using any existing libraries. And the bundler also has support for things like React and CSS, as well as TypeScript and JSX. You can also compile single file executables. For example, Cloud Code, for example, uses that feature. We spend a lot of time on Node.js compatibility.

Originally, Bund was designed to be a drop-in replacement for Node.js. And what that means is pretty much everything needs to work. We consider it a bug in Bund if something works in Node and doesn't work in Bund. And so if you do run into an issue like that, please just file an issue in Bund's repo. We do have a lot of GitHub issues open, but we do actually read all of them. It just takes a lot of time. But it's important.

2. Enhanced Bund Functionality

Short description:

Efficient Bund Features: Fast npm manager, tricks for quick installation, pnpm lockfile support, YAML parser integration, Jest-compatible test runner, and optimized runtime components for faster development.

And we've spent a lot of time just working on getting Node's test suite to pass in Bund, and we're still working on that. These numbers are slightly out of date. There's a bit more passing now. So there's other parts of Bund, too. So we have an incredibly fast npm package manager. In the previous version of Bund, we made it faster because there are certain really common npm packages that don't need to run either post-install scripts or lifecycle scripts, but they're sort of... Or when they do need to run them, the situation where they need to run them is very limited. Like if you didn't use... Or if you skipped optional dependencies. So there's a lot of tricks that we can do and we continue to do to make Bund install really fast. We also recently added support for pnpm lockfile migration. We wrote a whole YAML parser just for that, pretty much. And because of going back to what I was saying earlier about the different pieces of Bund... Use the different pieces of Bund, that YAML parser that we wrote for pnpm lockfile migration is also used by the bundler, so you can import YAML files in JavaScript at the runtime or at the bundler. So if you're building for front end, you can import the YAML file in your front-end code, and then the bundler will bundle it into JavaScript.

And then if you're importing it in the runtime, then you can just run a file. And this is pretty good for config stuff where maybe you want to load some get of action configuration or something along those lines. Bund test is a Jest compatible test runner. Uses the same expect API. And we also implement parts of the VTest specific APIs, like the VI global is there. And we kind of add a lot of built-in APIs. This is something that I think has been missing for a long time in the JavaScript ecosystem, that there's too many small packages that do something. You just have to install so many dependencies to be productive. And it's not necessary. In fact, it's faster if you can do it in the runtime, because there's just a lot of optimizations that you can do in kind of philosophically, we try to make every single part of Bund really fast. And it takes a lot of work to do that. But it makes the product so much better. And it just makes it so much faster to build stuff, too. Because it's like you can use the standard library or the built-in library and expect it to be fast and work pretty well. So, for example, Bund password is like Argon2 or bcrypt.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

How Bun Makes Building React Apps Simpler & Faster
React Day Berlin 2022React Day Berlin 2022
9 min
How Bun Makes Building React Apps Simpler & Faster
Top Content
BUN is a modern all-in-one JavaScript runtime environment that achieves new levels of performance. It includes BUN dev, a fast front-end dev server, BUN install, a speedy package manager, and BUN run, a fast package runner. BUN supports JSX, has optimized React server-side rendering, and offers hot module reloading on the server. The priorities for BUN include stability, node compatibility, documentation improvement, missing features in BUN install, AST plugin API, native Windows support, Bundler and Minifier optimization, and easier deployment to production. BUN's AST plugin API allows for bundle-time JavaScript execution and embedding code, potentially inspiring new frameworks.
Node.js Compatibility in Deno
Node Congress 2022Node Congress 2022
34 min
Node.js Compatibility in Deno
Deno aims to provide Node.js compatibility to make migration smoother and easier. While Deno can run apps and libraries offered for Node.js, not all are supported yet. There are trade-offs to consider, such as incompatible APIs and a less ideal developer experience. Deno is working on improving compatibility and the transition process. Efforts include porting Node.js modules, exploring a superset approach, and transparent package installation from npm.
Bun, Deno, Node.js? Recreating a JavaScript runtime from Scratch - Understand magic behind Node.js
Node Congress 2023Node Congress 2023
29 min
Bun, Deno, Node.js? Recreating a JavaScript runtime from Scratch - Understand magic behind Node.js
The Talk explores the magic behind Node.js and delves into its components, including V8, libuv, and the C++ bridge. It discusses the workflow and execution process, the use of NodeMod, and the understanding of console functions. The Talk also covers Node.js functions and scheduling, the introduction of runtimes, and the collaboration between JavaScript runtimes. It concludes with insights on content production, the choice of Node.js, and the inspiration behind it.
Eval all the strings! - Hardened JavaScript
Node Congress 2023Node Congress 2023
8 min
Eval all the strings! - Hardened JavaScript
NPM packages can be potentially dangerous, so it's important to be proactive in managing them. Lava Mode allows you to detect and investigate suspicious packages before deploying your app. Lavamote prevents unauthorized access to sensitive resources by isolating dependencies and using hardened JavaScript. Lava Mode makes it easier to analyze obfuscated files and understand their actions.
Roll you own JavaScript runtime
Node Congress 2023Node Congress 2023
21 min
Roll you own JavaScript runtime
This Talk introduces Deno, a custom JavaScript runtime similar to Node.js, and discusses the benefits of using a custom runtime. It explores the process of building a custom runtime with Deno in Rust, including the integration with Cargo and the ability to mix and match crates and APIs. The Talk also covers the implementation of the setTimeout function in both Run.js and Runtime.js, and provides examples of how to fix errors and implement additional functions. Overall, the Talk highlights the flexibility and possibilities of creating custom runtimes with Deno.
The Future of JavaScript Runtimes
Node Congress 2022Node Congress 2022
34 min
The Future of JavaScript Runtimes
Today's Talk explores the future of JavaScript runtimes, their evolution, and impact on software development. It discusses the historical trends of JavaScript, the adoption of new tools and libraries, and the convergence of Node and Deno. The emergence of isolate clouds and their potential to replace traditional VMs and containers is also highlighted. Additionally, the talk touches on the possibilities of JavaScript in exotic use cases, its impact on machine learning, and the potential for TypeScript to become the de facto language for JavaScript development.

Workshops on related topic

Build Peer-to-Peer Applications with Pear Runtime
JSNation 2024JSNation 2024
152 min
Build Peer-to-Peer Applications with Pear Runtime
WorkshopFree
David Mark Clements
David Mark Clements
Learn how to rapidly build peer-to-peer applications with Pear Runtime. No servers required. Understand peer-to-peer paradigms and construct applications from well-defined building blocks. This workshop will cover how to create both Desktop and Terminal applications (with discussion for Mobile) that work entirely peer-to-peer from anywhere in the world. By the end of this workshop you should know how to build a new type of highly scalable application with entirely reduced infrastructural costs (~0) along with suitable architectures and best practices for peer-to-peer applications. From the creator of Pear Runtime and the company that brings us keet.io. Table of content:- Introducing Pear- Initial Q & A- Getting Setup- Creating a Pear Desktop Application- Sharing a Pear Application- Running a Pear Application- Creating a Pear Terminal Application- Releasing a Pear Application- Architectural Discussions- Wrap-up Q & A