Skip to content

Installation

Install only the packages required by the boundary you are modeling.

If you use an adapter package, it already depends on @xndrjs/domain and re-exports the domain APIs for convenient single-entry imports.

Use the core package when you want to provide your own validators or use the built-in compose helpers.

Terminal window
pnpm add @xndrjs/domain
import { compose, domain, pipe } from "@xndrjs/domain";

Use this when your project already uses Zod or you want parser-style transforms at the boundary.

Terminal window
pnpm add @xndrjs/domain-zod zod
import { domain, zodFromKit, zodToValidator } from "@xndrjs/domain-zod";

Use this when your project prefers Valibot’s function-first schema style.

Terminal window
pnpm add @xndrjs/domain-valibot valibot
import { domain, valibotFromKit, valibotToValidator } from "@xndrjs/domain-valibot";

Use this when contracts already exist as JSON Schema or OpenAPI components.

Terminal window
pnpm add @xndrjs/domain-ajv ajv ajv-formats
import { domain, jsonSchemaToValidator, openApiComponentToValidator } from "@xndrjs/domain-ajv";

These packages are optional and solve problems outside the domain modeling core:

Terminal window
pnpm add @xndrjs/tasks

See Tasks for how @xndrjs/tasks fits alongside the rest of xndrjs.

All public packages are TypeScript-first and include type definitions. Packages target Node.js 18+.

For new domain work, use @xndrjs/domain plus one adapter.