Documentation

Getting started

Install TinyJS, create the smallest valid project, and render your first page.

TinyJS requires Node.js 22 or newer. Install it in your project with npm:

npm install @carl.fyi/tinyjs

Create a site

A complete TinyJS project includes its package metadata and TypeScript configuration alongside the site configuration, pages, and templates.

package.json
package-lock.json
tsconfig.json
site.yaml
pages/
├── layout.tsx
└── page.yaml
templates/
└── default.tsx

Add site.yaml at the project root:

name: My TinyJS site
description: A small site made from files.

Add pages/page.yaml:

template: default
title: Hello, TinyJS
content: This value is escaped automatically.

Add a root layout at pages/layout.tsx and a matching templates/default.tsx. Continue to templates and layouts for complete examples.

Preview locally

From the directory containing site.yaml, run:

npx tinyjs serve

TinyJS serves the site at http://127.0.0.1:8080 by default. The production server compiles TSX once at startup, while YAML and JSON page content is read again for every render. Restart after changing TSX or site configuration.

Build static HTML

npx tinyjs build

The same renderer writes the complete site to dist/. Your next stop is file conventions.