DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Abhay Prajapati
Abhay Prajapati

Posted on

So tried bun! the new JS runtime.

bun-scripts

Installation

$ curl https://bun.sh/install | bash
Enter fullscreen mode Exit fullscreen mode

after this i opened my .bashrc and added the following line:

BUN_INSTALL="/root/.bun"
PATH="$BUN_INSTALL/bin:$PATH"
# as it wasn't added automatically, i added it manually
Enter fullscreen mode Exit fullscreen mode

i restarted my terminal and it worked! πŸŽ‰

working with .env and bun

# then i did a fancy stuff
echo PORT=5000 >> .env
touch http.js
Enter fullscreen mode Exit fullscreen mode
// http.js
console.log(process.env.PORT)
// USING ENVIRONMENT VARIABLES WITHOUT DOTENV MODULES.
Enter fullscreen mode Exit fullscreen mode
bun run http.js
Enter fullscreen mode Exit fullscreen mode

bunrun

checkout the code @repo

sugggest me what should i try next with bun

🀝🏾Connect me on:
Twitter: πŸ•ŠοΈ@Abhayprajapati_
Github: 🐧@theabhayprajapati

Oldest comments (4)

Collapse
 
lexlohr profile image
Alex Lohr

PSA: Running everything (but especially shell scripts from the web) as root is dangerous. It's not a coincidence that on Linux, user accounts have limited permissions.

Collapse
 
ankush981 profile image
Ankush Thakur

And?

Collapse
 
theabhayprajapati profile image
Abhay Prajapati Author

it was great 😁

Collapse
 
ankush981 profile image
Ankush Thakur

Cool! ^.^ I think your post should've been about the "it was great" part and why it was great, but all fine. :P

Classic DEV Post from 2020:

js visualized

πŸš€βš™οΈ JavaScript Visualized: the JavaScript Engine

As JavaScript devs, we usually don't have to deal with compilers ourselves. However, it's definitely good to know the basics of the JavaScript engine and see how it handles our human-friendly JS code, and turns it into something machines understand! πŸ₯³

Happy coding!