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>
`;
}