zachwinnie / bun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bun

Install

curl -fsSL https://bun.sh/install | bash

More at https://bun.sh/docs

Commands

First, install dependencies with bun install, then:

bun --watch run bun.ts

OR

bun run bun.ts

To build the React component, run:

bun build react.tsx --outdir ./build

Deno

Install

curl -fsSL https://deno.land/x/install/install.sh | sh

Then install and enable the VSCode extension and add settings at .vscode/settings.json:

{
  "deno.config": "./tsconfig.json",
  "deno.enable": true,
  "deno.lint": true,
  "deno.unstable": true
}

More at https://docs.deno.com/runtime/manual

Commands

deno run --allow-net --watch deno.ts

OR

deno run --allow-net deno.ts

To build the React component, run:

deno run react.tsx

Node

Install

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
nvm install 21

More at https://github.com/nvm-sh/nvm and https://nodejs.org/en

Commands

First, install dependencies with npm install, then:

node --watch node.js

OR

node node.js

First, install TypeScript with npm install typescript --global, then to build the React component, run:

tsc react.tsx --esModuleInterop --jsx react --outDir ./build

Ruby

For comparison, we can also run a Ruby (Rack) server.

Install

curl -sSL https://get.rvm.io | bash -s stable
rvm install 3.2.2

More at https://rvm.io

Commands

First, install Rack:

gem install rack
gem install rackup

Then run the server:

rackup

Benchmarking

While servers above are running, you can run autocannon benchmarking:

npm run autocannon:bun
npm run autocannon:deno
npm run autocannon:node
npm run autocannon:ruby

Alternatively, you can run loadtest:

npm run loadtest:bun
npm run loadtest:deno
npm run loadtest:node
npm run loadtest:ruby

About


Languages

Language:Ruby 44.3%Language:TypeScript 36.4%Language:JavaScript 19.3%