DEV Community

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

Top 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

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