¿Qué es Bun y para qué se utiliza?

2025.01.23 03:35 Informal_Test_633 ¿Qué es Bun y para qué se utiliza?

Buenas, como dije en un comentario anterior, voy a pasar a explicar (en el poco tiempo que llevo usando Bun) que es, y para que sirve.
¿Qué es Bun? Bun es un runtime y all-in-one toolkit tanto para Javascript como para Typescript. Está escrito en Zig y está diseñado como una alternativa a Node.js pero "con esteroides". Se caracteriza por su rapidez y su buen uso de la memoria, además de ofrecer una suite de diferentes cosas para desarrollar apps.
En palabras de ellos:

Bun is designed as a faster, leaner, more modern replacement for Node.js.
Metas de Bun: Bun no es solamente un runtime de Node, es un set completo para desarrollar apps, con un package manager, un transpilador, una suite completa de test, etc. Personalmente lo probé en el lado del backend y donde más note una diferencia siendo desarrollador fue en la suite de test.
Test runner: Antes siempre testeaba con Jest ya que es una de las más conocidas, luego probé Bun y realmente se siente una diferencia en la velocidad al testear, los test corren mucho más rápido. Les recomiendo que le den una oportunidad al test runner en algunos test al menos, o en sus side project. De hecho ya muestran como se puede migrar de Jest a Bun al testar, pueden verlo acá.
Ejemplos en backend: Dado que es el único lugar donde yo lo utilicé, voy a dar unos ejemplos simples para el lado del backend.
Primero se necesita instalar Bun, pero una vez instalado, se puede ejecutar el siguiente comando para crear un proyecto:
bun init 
Este comando creará un archivo index.ts listo para ejecutarse y poder comenzar a desarrollar. Y para levantar un server de manera sencilla, se puede copiar este codigo en el archivo index.ts y ejecutarlo con el comando bun run index.ts
const server = Bun.serve({ fetch(req) { const url = new URL(req.url); if (url.pathname === "/ping") return new Response("pong"); return new Response("Page not found - 404"); }, }); console.log(`Listening on http://localhost:${server.port} ...`); 
Esto levantará un servidor simple de Bun en el puerto :3000. Utilizando curl o cualquier cliente se le puede pegar al endpoint para ver que ocurre:
> curl http://localhost:3000/ping pong% 
Devuelve un pong como configuramos previamente, pero si ahora le pegamos a otra ruta que no existe, como "/hello" ocurre esto
> curl http://localhost:3000/hello Page not found - 404% 
Por defecto nos da una response indicando que el recurso al que queremos acceder no existe.
Y así de muchas maneras más, el HTTP server nativo es muy poderoso.
Este es un ejemplo muy simple pero es una manera de levantar un server HTTP únicamente con Bun, y a su vez se puede hacer todo con Bun, se podría hacer una API completa simple para ver hasta donde se puede llegar, testeando, levantando el HTTP server y demás. La idea de este posteo es introducir a la gente en Bun y que le dé una oportunidad.
La verdad quería explayarme más sobre las nuevas características que introdujeron, pero me parece que ya se está haciendo muy largo así que prefiero dejar el enlace al blog para que puedan chusmear por su cuenta en caso de que les siga interesando: https://bun.sh/blog . Sobre todo la última update que sacaron.
Final Me gustaría saber que opinan, que les pareció el posteo, si prefieren seguir viendo este tipo de cosas.
Me gustó porque me obligó a investigar y saber de lo que estoy hablando. Por supuesto que no utilicé Bun al 100% ni le saqué el máximo provecho, pero si es algo que me interesa y me parece que va por buen camino, y en mi experiencia fue agradable desarrollar con la misma. Además de que opino que la mejor manera de aprender algo por su cuenta es enseñándolo.
¡Gracias por leer!
Fuentes submitted by Informal_Test_633 to devsarg [link] [comments]


2025.01.23 03:35 Aromatic-Ostrich2997 Found them

Found them I
submitted by Aromatic-Ostrich2997 to foundstaple3456 [link] [comments]


2025.01.23 03:35 Lucky_Armadillo9656 Regarding a sublet and takeover for summer or in the next month or two. The contract can be renewed again as well.

Regarding a sublet and takeover for summer or in the next month or two. The contract can be renewed again as well. Hey I’m actually talking a deferral for research purposes and hence me and my roommate are moving out of 180 York. It’s a one bedroom ( with a sliding door ) I asked a few people why they said it’s a futuristic concept so I was like why not I mostly got this via a realtor but if anyone wants to sublet or move in within the next month or two pie even summer let me know It’s 1950. Depending upon your living style and personal preference, you can get it for 975 if you share it with your close busy with single beds. I tried to find a one room here it was the same size almost but the two bedroom here was like 2.6+ k. It also has a skyline view with newly furnished stuff and once we move out he will refurbish some stuff again. It has a built in laundry ands you only pay electricity. Anything you want replaced n when you move in can be done by the landlord. So I’m looking for someone as it’s a first come first serve basis. It has a pool table with conference room and gym. Barbecue area and lounge area free for all and all included. It has a chute in front of my room so really convenient. It has double security plus Amazon gets delivered into the mail room in the lobby and outside your door.
submitted by Lucky_Armadillo9656 to geegees [link] [comments]


2025.01.23 03:35 Zampierre_Top1 Guaraná e sopa do macaco una delicia

Guaraná e sopa do macaco una delicia submitted by Zampierre_Top1 to 2latinoforyou [link] [comments]


2025.01.23 03:35 ChickenSnicker Dog Antibiotic given 24hrs instead of every 12

I went to the vet last week and my dog had a bacterial infection. They gave her a penicillin shot and then a bottle of Antibiotics to give her. I got confused and heard 24hrs but the vet mentioned 24hrs after the shot give her the meds. So I've been giving my dog Antibiotic only every 24hrs. I read the bottle and realized my mistake 5 days after starting the meds. Do I just increase her dose to every 12 hrs and get through the last of the Antibiotic or do I need to get more? Thank you in advance!
submitted by ChickenSnicker to AskVet [link] [comments]


2025.01.23 03:35 shadow_spinner0 In Franchise what is the best playbook for a Run And Shoot Scheme?

When I play I just use the Run And Shoot playbook, but I sim a lot and I want the best playbook that matches with that offensive scheme.
submitted by shadow_spinner0 to Madden [link] [comments]


2025.01.23 03:35 Finn_the_creature Doodled the lamb!!

Doodled the lamb!! Really love these doodles!! Honestly so proud of them!
submitted by Finn_the_creature to CultOfTheLamb [link] [comments]


2025.01.23 03:35 Pigeonslayer12 best budget standing/sitting desk

im looking for a new standing desk for my setup, what are some good budget options?
submitted by Pigeonslayer12 to desksetup [link] [comments]


2025.01.23 03:35 Feroset If you walked onto a Ford dealership lot in 1980 during peak gas crisis and saw a used 1969 Boss Mustang would it be cheap?

I randomly thought about this today. It wouldn't be seen as some incredible classic collectible just 10 years later during the malaise era would it? Would they be seen as cheap or undesirable relics? What would one with 50k Miles sold for then?
submitted by Feroset to Mustang [link] [comments]


2025.01.23 03:35 prodbypoetics saw this on spotify 😂

saw this on spotify 😂 saw this on spotify and just wanted to come share it over here. 😂 "I'll spend all my rupees to make you love me😂😂
here's the link if anyone wanna go check it out.
https://open.spotify.com/playlist/4ILQe7O5LAkSTHKcXQOUDB?si=neMRCF-cQKusJUI6chLEeg&pi=GPpgn83OQ6ym4
submitted by prodbypoetics to OcarinaOfTime [link] [comments]


2025.01.23 03:35 OrganicUniversity950 Am I tripping?

Every time I ask questions about my haul/parcel either on Reddit or email. I feel like the next day it updates when someone messages me back😂just wondering if someone else goes through this
submitted by OrganicUniversity950 to AllChinabuy [link] [comments]


2025.01.23 03:35 missedinsunday The main issue...

The main issue... submitted by missedinsunday to exmormon [link] [comments]


2025.01.23 03:35 smalltalk_king Some Cards I made thats inspired by an anime I like

submitted by smalltalk_king to custommagic [link] [comments]


2025.01.23 03:35 jyd921 Using submarines to attack battelships

I am trying to defeat two enemy battleships. Everytime I attack my submarine is destroyed in minutes. What I am doing wrong? What is the correct way to use submarines?
submitted by jyd921 to Supremacy1914 [link] [comments]


2025.01.23 03:35 Jonathan-Smith Montessori toys and color maze

submitted by Jonathan-Smith to impressively [link] [comments]


2025.01.23 03:35 AutoNewspaperAdmin [AU] - ‘A challenge’: Billions set aside for services in budget LNP wants to balance | Sydney Morning Herald

[AU] - ‘A challenge’: Billions set aside for services in budget LNP wants to balance | Sydney Morning Herald submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2025.01.23 03:35 Hogge_Interactive The Legend of Zelda: Echoes of Wisdom | Might Crystal | Hyrule Field

submitted by Hogge_Interactive to zelda_community [link] [comments]


2025.01.23 03:35 AutoNewspaperAdmin [Environment] - Sydney’s long-awaited, foul-smelling ‘corpse flower’ is finally blooming | Sydney Morning Herald

[Environment] - Sydney’s long-awaited, foul-smelling ‘corpse flower’ is finally blooming | Sydney Morning Herald submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2025.01.23 03:35 Unusual_Poem_9864 Here it is, enjoy

https://archive.org/details/sonyfit-copy/mode/1up
submitted by Unusual_Poem_9864 to camcorders [link] [comments]


2025.01.23 03:35 scaredandrambling Into the closet, out of eye sight.

Back into the closet I go. Purging all my accounts of evidence of my gender identity and sexuality. Because if I don't, there's a very real risk this becomes like the Holocaust and my life gets sold out for not fitting in. I'm so genuinely terrified. I know I said I have a plan and a place to escape if it gets bad. But I don't really believe those will keep me safe. If they pull my medical records they'll see. Fuck. The government already has those. FUUUUUUCK. Jesus fuck I am so incredibly scared for my life, safety, and future. I'm wishing I had killed myself at 14. I so badly wish I had so that hopeful little kid could've died ignorant to the world's issues. I'm so scared. And there's nothing that can be done. If it gets bad enough I can apply for refugee status in some countries but I don't know if it'll be soon enough.
My ancestors lived through the Armenian genocide, but barely. My grandfather escaped from Armenian as a child. All of his children except my father got to live in a world where they didn't fear for their families lives. My father is being forced to watch what his father escaped, occur once more. My grandfather fought in world war 2, my father in Vietnam. I fear there won't be a war for my generation to fight in as the world watches my country grow violent and they fear for the safety of their own countries.
I'm so genuinely scared that the thought of killing myself has been on my mind more than ever. But I won't leave my cat. I can't leave my cat. He's the only real rope I have keeping me here. I love you all. But my cat would die without me. I can't die before him. I won't. But God fuck I am so incredibly terrified. And I don't think anything can be done. I'm a solver. A helper. But now, no one can help. Nothing can be done. I am forced to live through an oncoming genocide that might involve me.
I've never believed in a god. I've always hated whatever created me. But for once, I am praying to whatever or whoever created me to protect me.
submitted by scaredandrambling to TrueOffMyChest [link] [comments]


2025.01.23 03:35 GeorgeYDesign Tens of thousands without power, car crushed during savage NSW storm

Tens of thousands without power, car crushed during savage NSW storm submitted by GeorgeYDesign to ABCaus [link] [comments]


2025.01.23 03:35 AutoNewspaperAdmin [AU] - Alleged killer fronts court after burnt body found near cemetery in regional Victoria | Sydney Morning Herald

[AU] - Alleged killer fronts court after burnt body found near cemetery in regional Victoria | Sydney Morning Herald submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2025.01.23 03:35 Green-Winner-4289 75th Ranger regiment personnel identities?

What’s the go with personnel in the ranger regiment and keeping their identities hidden? I’ve seen photos and videos where they’ve blacked out their faces to hide it but then I see others where they aren’t. Even on the offical army page they blur some but not others. How does it work who gets their identity hidden? Does it depend on your role within the regiment.
submitted by Green-Winner-4289 to army [link] [comments]


2025.01.23 03:35 GeorgeYDesign A village of Russians living it up in Bali has been shut down by authorities

A village of Russians living it up in Bali has been shut down by authorities submitted by GeorgeYDesign to ABCaus [link] [comments]


2025.01.23 03:35 No-Kitchen-8623 BBQ JR7NQG

submitted by No-Kitchen-8623 to unioncircle [link] [comments]


https://google.com/