Mind Blowing Features of Bun 1.2

  • Home
  • Mind Blowing Features of Bun 1.2

Bun now getting famous and many companies are adopting it as their primary runtime environment instead of node. They recently released Bun 1.2 and other than speed, there are some cool features you might like it

Run C within Javascript

Now you can run C or C++ within js. if there is any CPU utilisation task. you can run without any additional configuration.

Build in AWS S3 support

You can use S3 directly on your project without any additional packages and it’s more optimized for speed.

import { s3 } from "bun";

const file = s3.file("folder/my-file.txt");
// file instanceof Blob

const content = await file.text();

Postgres support

If you are using Bun. you don’t need any other ORM for Postgress since Bun providing a faster one

import { sql } from "bun";

const users = [
  { name: "Alice", age: 25 },
  { name: "Bob", age: 65 },
];

await sql`
  INSERT INTO users (name, age)
  VALUES ${sql(users)}
`;

CSS parser

Bun provides a CSS parser derived from the popular library LightningCSS. Bun CSS bundlers combine multiple CSS files and assets referenced using directives like url, @import, @font-face, into a single CSS file, you can send to browsers, avoiding a waterfall of network requests.

Conclusion

I have just listed what I liked, More features are included in Bun 1.2 and 1.2.1 read more here. thank you for reading

author

By Habil M

Software Engineer

Date

2025-03-11T10:10:23

This website uses cookies to improve your experience. By continuing to browse, you consent to our use of cookies and agree to our Privacy Policy.