Experience blazing-fast performance by running your NestJS apps on Bun, with instant startup times, a lightning-quick package manager, and the ability to execute TypeScript directly without a separate build step.
See how Bun can streamline your workflow while delivering serious speed gains for your APIs.
Length 15:19
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #bun #javascript #typescript #nestjs #runtime #web development #programming #docker #husky #cli
0:00 Hey everyone. Today, we're gonna take a look at using Bun. 0:03 So Bun is a JavaScript runtime. Just like 0:06 Node.js is a JavaScript runtime that allows us to actually 0:10 execute our JavaScript code on the server side, 0:14 Bun is an alternative for Node.js that is actually much 0:18 faster, and we can see here from these benchmarks 0:21 on this image, I'm on the 0:22 bun.sh site. 0:24 We can see some benchmarks here comparing Bun to some other alternatives. 0:28 So we have Node.js here in an Express server. 0:31 We can see the HTTP requests per second are so 0:34 much faster on Bun compared to Node, and even beating out Deno here. 0:39 We can even see another example here for a Postgres 0:43 query benchmark where Bun is beating out both Node 0:47 and Deno substantially, and finally, with a WebSocket 0:51 server as well. 0:52 So this is one of the big advantages of switching to Bun, which is a 0:56 newer JavaScript runtime, is the performance benefits. 1:00 Along with the performance benefits, there's a number of developer experience 1:04 improvements that Bun introduces. 1:06 Namely, the fact that Bun can execute TypeScript directly 1:10 without having to actually compile it to JavaScript first. 1:14 And so this improves the developer experience dramatically because we don't 1:17 have to 1:18 wait to compile a bunch of TypeScript into JavaScript. 1:21 We can actually execute our TypeScript directly. 1:25 Now, Bun is built off of the Rust language, 1:27 the underlying compiler, and 1:29 so it's much faster to actually execute. 1:32 And so in this lecture, we're gonna see how we can use Bun inside 1:34 of a NestJS 1:35 application and use it in the real world. 1:38 Now, Bun is also a dependency manager, so we can use it to install our 1:42 dependencies just like we would for npm or pnpm. 1:47 So let's go ahead and get started with trying out Bun.
The rest of the transcript is for members.
Sign in