Installation
xil is one package. Optional modules ship as subpaths of it, not separate packages.
Requirements
Section titled “Requirements”- Node.js 22 or later.
- An ESM project (
"type": "module"inpackage.json, or.mtsfiles). - A Standard Schema library for validation — Zod, Valibot, or ArkType. xil depends on none of them; pick one.
Install
Section titled “Install”pnpm add @architectine/xil zodnpm install @architectine/xil zodyarn add @architectine/xil zodExpress itself ships inside @architectine/xil — there is nothing else to install for the core. Zod is one option among three; swap it for valibot or arktype and nothing else in this guide changes.
Subpaths
Section titled “Subpaths”Each optional module is a subpath import. Nothing is registered unless you import and construct it.
| Import | What it adds |
|---|---|
@architectine/xil |
createApp, Router, Ctx, errors, hooks, logging, config, events, cache |
@architectine/xil/auth |
sessions, JWTs, opaque tokens, password hashing |
@architectine/xil/upload |
multipart file uploads |
@architectine/xil/rate-limit |
request rate limiting |
@architectine/xil/openapi |
OpenAPI 3.1 generation and a docs UI |
Optional peer packages
Section titled “Optional peer packages”A few features reach for a package only when you use them. Each throws a clear message naming the install command if you use the feature without it.
| Package | Needed for |
|---|---|
@keyv/redis |
redisStore() in the cache module |
ioredis |
a Redis-backed rate limiter |
@node-rs/argon2 |
argon2() password hashing in the auth module |
@valibot/to-json-schema |
converting Valibot schemas for the OpenAPI module |
Zod and ArkType need no extra package for OpenAPI conversion; both expose the conversion xil needs directly.
Continue to Your first app to build something with it, or jump straight to a module’s guide if you already know what you’re using it for.