Yes, you can use JavaScript and TypeScript with Bun.js for building desktop applications. Bun.js is designed as a comprehensive JavaScript runtime that supports both JavaScript and TypeScript natively, allowing you to run TypeScript files directly without the need for transpilation or additional configuration[1][2][4].
Key Features
- Direct Execution: Bun can execute TypeScript files directly using the `.ts` extension, simplifying the development process by eliminating the need for a separate build step[1][4].
- JSX Support: Bun also supports JSX (and TSX), enabling developers to use React or similar libraries seamlessly within their projects[2][3].
- Compatibility with Node.js: Bun is designed to be a drop-in replacement for Node.js, which means you can use existing Node.js libraries and frameworks with minimal adjustments[2][4].
- Bundling and Packaging: While Bun currently requires Golang for packaging desktop apps, it provides built-in tools for bundling JavaScript and TypeScript code, making it easier to prepare your application for distribution[6].
In summary, Bun.js allows developers to leverage both JavaScript and TypeScript effectively in their desktop applications, providing a modern and efficient development environment.
Citations:[1] https://www.techloset.com/blog/bun-new-javascript-runtime-replaces-nodejs
[2] https://www.allthingstypescript.dev/p/bun-one-tool-for-all-your-javascripttypescript
[3] https://bunjs.run
[4] https://dev.to/kalashin1/bun-the-next-big-thing-in-javascript-jeg
[5] https://bun.sh/blog/bun-v1.0
[6] https://github.com/Bunland/webapp
[7] https://bun.sh/blog/bun-v1.1
[8] https://dev.to/thejaredwilcurt/bun-hype-how-we-learned-nothing-from-yarn-2n3j