Installation
Requirements
binja requires Bun runtime. Node.js is not supported.
# Install Bun if you haven't alreadycurl -fsSL https://bun.sh/install | bashInstall binja
bun add binjaThat’s it! No external dependencies required.
Optional: AI Linting
If you want to use AI-powered template linting, install the SDK for your preferred provider:
# For Claude (Anthropic)bun add @anthropic-ai/sdk
# For OpenAIbun add openai
# For Ollama (local) or Groq - no package neededVerify Installation
Create a simple test file:
import { render } from 'binja'
const html = await render('Hello, {{ name }}!', { name: 'binja' })console.log(html) // Output: Hello, binja!Run it:
bun run test.tsTypeScript Configuration
binja is written in TypeScript and includes full type definitions. No additional configuration needed.
import { render, compile, Environment } from 'binja'import type { FilterFunction, Context } from 'binja'Project Structure (Recommended)
my-app/├── src/│ ├── index.ts│ └── routes/├── views/ # Template files│ ├── base.html│ ├── pages/│ │ ├── home.html│ │ └── about.html│ └── components/│ ├── header.html│ └── footer.html├── package.json└── tsconfig.jsonNext Steps
- Quick Start - Create your first template
- Environment - Configure template loading