Package map
Use this page when deciding which package belongs in which layer.
| Package | Role | Install when |
|---|---|---|
@xndrjs/domain | Validator-agnostic domain core | You want primitives, shapes, proofs, capabilities, compose, or pipe |
@xndrjs/domain-zod | Zod 4 adapter | Your boundary already uses Zod or needs Zod transforms |
@xndrjs/domain-valibot | Valibot adapter | You prefer Valibot schemas or small function-first validators |
@xndrjs/domain-ajv | AJV adapter | Your contracts are JSON Schema or OpenAPI |
@xndrjs/tasks | Lazy async tasks with retry | You want composable async effects in infrastructure code |
@xndrjs/bench-perf | Private benchmark suite | Internal monorepo performance comparisons |
Recommended imports
Section titled “Recommended imports”If you use an adapter, import domain APIs from the adapter package:
import { domain, zodToValidator } from "@xndrjs/domain-zod";If you do not use an adapter, import from the core:
import { compose, domain, pipe } from "@xndrjs/domain";Dependency notes
Section titled “Dependency notes”@xndrjs/domain-zodexpects Zod 4.@xndrjs/domain-valibotexpects Valibot matching the adapter major.@xndrjs/domain-ajvexpects AJV andajv-formats.