jeffalo — 7/10/2025, 9:27:58 PM

not sure how big my javascript developing audience on wasteof is but:

bun is really amazing for weird hacky things.

for instance, i wanted to test the logic of a function from a giant server side app that has loads of require() s for a bunch of libraries that only work in server side nodejs.

normally, this would be really painful, and i’d have to modify the script manually to make it work in the browser. most likely, it’ll be less work just to reimplement the function in browser compatible js.

but with bun.. no problem at all. i can literally just write an html file with <script type=”module”> that straight up imports the file, bun figures out all the cjs/esm/whatever, and lets me compile that out to a website that somehow magically works. bun is really cool.

i even wrote a sketchy script to inline everything and send it off to my server (which generates a url i can share with my colleagues). insane iterative feedback loop.

♥ 20 ↩ 0 💬 12 comments

comments

chiroyce:

im not js expert but this is similar to what vite does right? except bun is a one time global install

7/13/2025, 1:28:15 PM
jeffalo:

i think yeah. vite is a ‘build tool’ which means it does this stuff. i think?

7/13/2025, 2:18:40 PM
eris:

can't wait to make an electron app that runs in a browser

7/11/2025, 3:18:55 PM
late:

this is cool but im not very smart

7/11/2025, 5:14:49 AM
souple:

samj

7/11/2025, 12:24:35 PM
theglasspenguin:

this would’ve solved many problems when i kept defaulting to node (because it was considered the standard by most people i talked to about it)

7/11/2025, 1:19:30 AM
busybird15:

wait so it turns a node js app into native html/js app?

7/11/2025, 12:16:45 AM
jeffalo:

bundles a js module from a nodejs app and lets me import it in the browser yes

7/11/2025, 7:30:22 AM
owl:

Could this be used with discord.js

7/11/2025, 7:57:56 AM
jeffalo:

sorta? but you’re probably not going to be writing a discord bot that runs in a browser

7/11/2025, 2:31:09 PM
busybird15:

yoo epic

7/12/2025, 12:58:58 PM
flux:

bun is awesome

7/10/2025, 11:13:53 PM