Docs//Home
GitHub
Documentation ยท v1.4.5

Nix.js Kit

A full-stack meta-framework with Next.js conventions and Astro-style islands. Zero client JS by default โ€” Nix.js stays at ~14KB.

119 tests passing ~14 KB client runtime TypeScript 7 Zero dependencies
๐Ÿ“
File-based routing
page.ts, layout.ts, dynamic routes [slug], catch-all [...slug], and route groups (group).
๐Ÿ๏ธ
Islands architecture
Hydrate only the interactive components. load, idle, and visible directives.
โšก
SSG + SSR + ISR
Static generation, on-demand SSR, and incremental static regeneration with disk cache and TTL.
๐Ÿ”
Server actions
Type-safe server functions with CSRF protection, progressive enhancement, and ephemeral error cookies.
๐Ÿ“
Content layer
Typed Markdown collections with YAML frontmatter, optional zod validation, and marked rendering.
๐Ÿ–ผ๏ธ
Image optimization
Responsive image() helper with srcset/sizes. Build-time WebP/AVIF via sharp.
๐Ÿงญ
SPA router
Client-side navigation with prefetch, View Transitions, scroll restoration, and head merge.
๐Ÿ›ก๏ธ
Middleware
src/middleware.ts with path matchers for auth, redirects, and header injection.
๐Ÿš€
Deploy anywhere
Adapters for Vercel, Netlify, Bun, and Node. Or run your own server with createSsrServer.

Quick example

src/app/page.tstypescript
// src/app/page.ts
import { html } from "@deijose/nix-js";
import type { PageProps } from "@deijose/nix-js-kit";
import { island } from "@deijose/nix-js-kit";
import { load } from "./page.data.ts";
import Counter from "../islands/Counter";

export default function HomePage({ data }: PageProps<typeof load>) {
  return html`
    <article>
      <h1>${data.title}</h1>
      <p>The answer is ${data.count}.</p>
      ${island("Counter", Counter, { initial: 0 }, "load")}
    </article>
  `;
}

Nix.js Kit is open source โ€” GitHub ยท npm ยท MIT License

โœŽ Edit this page on GitHub