Core runtime
Bootstrap, DI container, lifecycle orchestration, and HTTP application startup.
Packages
This page maps the main packages in the xtask monorepo, what each package provides, how it fits into the runtime, and which official samples demonstrate it in practice, including cache, scheduler, queues, and value objects.
16 packages documented
Bootstrap, DI container, lifecycle orchestration, and HTTP application startup.
Express and Fastify adapters preserve the same controller and view contracts.
TypeORM, security, mailer, cache, scheduler, and queues attach lifecycle-aware persistence, authentication, background work, and delivery features.
Catalog
packages/core
Bootstrap, kernel, DI container, lifecycle, and HTTP application primitives.
Core owns application startup. It boots the kernel, scans components, resolves adapters, and coordinates optional integrations like TypeORM and security during CreateApplication().
Sample coverage: 01-new_app, 02-express_app, 03-fastify_app, 04-typeorm_app, 06-security_app, 07-security_express_app
Open package pagepackages/common
Cross-package decorators, route metadata, logger, and shared execution types.
Common provides the public decorator surface for controllers and route pipelines. It is the language the rest of the framework uses to express middleware, guard, and event metadata, and it includes the Logger used across adapters and services.
Sample coverage: All samples use controller decorators from @xtaskjs/common.
Open package pagepackages/value-objects
Value object primitives, conversion helpers, DTO decorators, and DI factory integration helpers.
Value objects gives xtaskjs projects a consistent way to model domain primitives and structured payload wrappers. It standardizes conversion from raw input, JSON strings, and serialized payloads while optionally bridging DTO transformation and DI-managed factory creation.
Sample coverage: Package README examples and package tests currently provide the primary reference.
Open package pagepackages/express-http
Express adapter with static assets and template engine integration.
The Express adapter translates framework routes into Express request handling. It adds static files, template engines, and JSON or rendered-view responses without changing controller code.
Sample coverage: 02-express_app and 07-security_express_app
Open package pagepackages/fastify-http
Fastify adapter for the same controller model used by core and Express.
Fastify support mirrors Express support but keeps Fastify-specific serving, view rendering, and static file behavior behind the same framework contracts.
Sample coverage: 03-fastify_app and 04-typeorm_app
Open package pagepackages/typeorm
TypeORM integration with datasource registration, startup migrations and seeders, and repository injection helpers.
TypeORM support attaches datasource lifecycle to xtask startup and shutdown. It gives the container a standard way to inject datasources and repositories, while providing migration and seeder registries that can run during bootstrap.
Sample coverage: 04-typeorm_app
Open package pagepackages/cqrs
Command, query, and event buses with handler decorators, read or write datasource aliases, and lifecycle-managed projection workflows.
CQRS adds message buses, handler discovery, read or write repository injection, process managers, projection rebuilders, and idempotent command execution to xtaskjs. It builds on @xtaskjs/typeorm so the container can expose read and write datasources and repositories without hard-coding infrastructure details into handlers.
Sample coverage: 19-cqrs_app and 20-cqrs_postgres_replication_app
Open package pagepackages/event-source
Event-sourced aggregates, optimistic stream persistence, stored-event subscribers, and optional queue publication.
Event source adds aggregate rehydration, stream persistence, optimistic concurrency checks, and stored-event publication to xtaskjs. It keeps event application inside aggregate roots while exposing repositories, stores, publishers, and subscribers through the same DI lifecycle used by the rest of the framework.
Sample coverage: 21-event_source_rabbitmq_app and 22-event_source_cqrs_app
Open package pagepackages/security
JWT and JWE authentication, authorization decorators, and DI-aware security lifecycle.
Security builds on the core route pipeline. It registers strategies, authenticates requests through Passport-compatible flows, and injects auth state into route execution context for guards and controllers.
Sample coverage: 06-security_app and 07-security_express_app
Open package pagepackages/mailer
Nodemailer-backed delivery, template rendering, named transports, and DI-friendly mail services.
Mailer integrates outbound email into the same xtask lifecycle used by controllers and persistence. It registers transports at startup, exposes injectable mail services and transporters, and supports inline, EJS, or Handlebars-backed templates.
Sample coverage: 07-security_express_app and 08-email_express_app
Open package pagepackages/internationalization
Request-aware translations, locale fallback, namespace loading, and DI-friendly formatting services.
Internationalization adds request-scoped locale resolution, translation lookup, pluralization, and formatting helpers to the xtask lifecycle. It registers locale services before controllers resolve and exposes an injectable service for controllers, views, and domain presenters.
Sample coverage: 09-internationalization_app and 10-internationalization_express_app
Open package pagepackages/scheduler
Cron, interval, and timeout decorators with lifecycle-managed job discovery and control.
Scheduler adds recurring and delayed jobs to xtask services. It discovers decorated methods after the DI container is ready, runs boot jobs during initialization, starts recurring work on lifecycle ready, and exposes service APIs for inspection and manual execution.
Sample coverage: 11-scheduler_app
Open package pagepackages/cache
Memory and Redis-backed cache models, method decorators, runtime inspection, and browser cache policies.
Cache adds application-level data caching and client-facing HTTP cache control to xtaskjs. It registers named cache models, exposes injectable repositories and services, layers method decorators for cache read/write behavior, and can publish browser cache headers plus operational endpoints from the same package.
Sample coverage: 12-cache_app, 13-cache_redis_app, 14-http_cache_web_app, 15-fastify_http_cache_web_app
Open package pagepackages/queues
Transport-agnostic queue handlers, broker helpers, publish decorators, and lifecycle-managed consumers.
Queues brings broker-backed and in-memory message delivery into xtaskjs. It registers named transports, discovers decorated consumers from DI-managed services, exposes injectable producer APIs, and coordinates retries, dead-letter routing, and consumer start-stop behavior through the application lifecycle.
Sample coverage: 16-queues_memory_app and 17-queues_rabbitmq_app
Open package pagepackages/throttler
Per-endpoint and global rate limiting with memory or Redis backing and custom key generators.
Throttler integrates rate limiting into the xtask route pipeline. It limits requests per time window using configurable storage backends, supports custom key generators for IP, user, or API-key-based identification, and applies limits globally or per-method through decorators.
Sample coverage: 24-throttler_app
Open package pagepackages/socket-io
Socket.IO gateways, event decorators, injectable realtime services, and lifecycle-managed server attachment.
Socket.IO integrates realtime messaging into xtaskjs without leaving the framework's DI and lifecycle model. It discovers decorated gateway services, attaches to the live HTTP server during app.listen(), exposes namespaces and broadcast helpers through DI, and tears down cleanly during app.close().
Sample coverage: 23-socket_io_express_app
Open package page