Skip to main content

Installation

Balda.js supports multiple JavaScript runtimes. Choose the installation method that best fits your project.

Prerequisites

  • Node.js: Version 18 or higher
  • Bun: Version 1.0 or higher
  • Deno: Version 1.40 or higher
  • TypeScript: Version 5.0 or higher (recommended)

Installation Options

Node.js

# Using npm
npm install balda-js

# Using yarn
yarn add balda-js

# Using pnpm
pnpm add balda-js

Bun

# Using bun
bun add balda-js

Deno

// deno.json
{
"imports": {
"balda-js": "npm:balda-js"
}
}

TypeScript Setup

Balda.js is built with TypeScript and provides excellent type support. Make sure your tsconfig.json includes:

{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}

Development Dependencies

For development, you might want to install additional packages:

# TypeScript support
npm install -D typescript @types/node

# Testing
npm install -D vitest

# Development server
npm install -D tsx

# Code formatting
npm install -D prettier

Verify Installation

Create a simple test file to verify your installation:

// test-installation.ts
import { Server } from 'balda-js';

const server = new Server({
port: 3000
});

server.get('/', (req, res) => {
res.json({ message: 'Balda.js is working!' });
});

server.listen(() => {
console.log('Server running on http://localhost:3000');
});

Run the test:

# Node.js
npx tsx test-installation.ts

# Bun
bun run test-installation.ts

# Deno
deno run --allow-net test-installation.ts

Visit http://localhost:3000 to see the welcome message.

Next Steps

Now that you have Balda.js installed, check out our Quick Start Guide to build your first application.