Sections

Getting Started with MiniFW

Mini Framework (MiniFW) is a Bun-only library for server-rendered HTMX applications. It keeps application code close to standard HTML, CSS, and JavaScript while adding small, composable rendering primitives for pages, partials, layouts, and fragments. There is no application build step: Bun runs the TypeScript you write on the server.

Installation

Install MiniFW through JSR or npm:

Using JSR Repositories
# deno
deno add jsr:@calvinbonner/minifw

# npm
npx jsr add @calvinbonner/minifw

# pnpm
pnpm dlx jsr add @calvinbonner/minifw

# bun
bunx jsr add @calvinbonner/minifw

# yarn
yarn dlx jsr add @calvinbonner/minifw

Or, when using Deno, you can import directly from JSR without installing:

import { mini, page } from "jsr:@calvinbonner/minifw/core";
Using NPM Repositories
# npm
npm install @calvinbonner/minifw

# pnpm
pnpm add @calvinbonner/minifw

# bun
bun add @calvinbonner/minifw

# yarn
yarn add @calvinbonner/minifw

Quick Start

Create a server file such as app.ts:

import { mini, page } from "@calvinbonner/minifw/core";
import { html } from "@calvinbonner/minifw/helpers";

const server = mini({
  port: 3000,
  routes: {
    "/": page(() => html`<h1>Welcome to MiniFW</h1>`),
  },
});

console.log(`Mini is running at ${server.url}`);

Start it with Bun:

bun app.ts

Then, just open http://localhost:3000 to see your rendered application!