↑ ↓ to move · Enter to open · Esc to close

Start

Getting started

Install the CLI globally, create a site from the starter and run it.

#Install the CLI

Install White.js globally with the latest tag. This gives you the white command everywhere:

sh
npm install -g white-js@latest

Other package managers:

sh
pnpm add -g white-js@latest
yarn global add white-js@latest
bun add -g white-js@latest

Check it:

sh
white --version

You can also skip the global install and run the installer once with npx:

sh
npx white-js@latest install example:site my-site

The package exposes two binaries, white and white-js. Both point at the same file.

#Create a site

sh
white install example:site my-site
cd my-site
npm run dev

Open http://localhost:3000. The wizard asks for a folder, whether to install dependencies and whether to create a git repository, then shows live progress. Existing directories are never overwritten.

Skip the questions with arguments:

sh
white install example:site my-site --yes          # defaults, no questions
white install example:site my-site --no-install   # only download
white install example:site my-site --git          # also run git init

Without a terminal (CI, pipes) the installer prints plain lines and uses the defaults. Set NO_COLOR=1 to disable colors or WHITE_NO_ANIMATION=1 to disable decorative animation.

#Add White.js to an existing project

sh
npm install white-js

Add two scripts to package.json:

json
{
  "type": "module",
  "scripts": {
    "start": "white run",
    "dev": "white run dev"
  }
}

Create a page and its view:

sh
white make route about

Then run npm run dev for development or npm start for production.

#The starter at a glance

text
server/
  routes/
    client/index.js     GET /
    api/status.js       GET /api/status
app/
  views/                layout, pages, partials, error page
  public/               styles, scripts, static assets
white.config.js         optional: only what you change
.env                    PORT, LOG_LEVEL (copy from .env.example)

Routes are discovered from files under server/routes. Templates live in app/views, and static files are served from app/public.

#Next steps