Skip to content

Package Overview

ModularityJS is organized as a monorepo with packages grouped by role.

Core

PackageDescription
@modularityjs/diAbstract DI contract — decorators and container interface
@modularityjs/di-inversifyInversifyJS implementation of the DI contract
@modularityjs/modularityModule system — loader, lifecycle, pools, validators
@modularityjs/pluginsPlugin system with before/after/around interception

Contracts and Drivers

Each service follows the contract/driver pattern: an abstract contract package and one or more concrete driver packages. See Architecture for details on the two variants (service contracts and module-level contracts).

Service Contracts

ServiceContractDrivers
Cache@modularityjs/cachecache-memory, cache-redis
Lock@modularityjs/locklock-memory, lock-redis
Queue@modularityjs/queuequeue-memory, queue-redis
Storage@modularityjs/storagestorage-memory, storage-local, storage-s3
Logger@modularityjs/loggerlogger-console

Module-Level Contracts

ServiceContractDriverDescription
HTTP@modularityjs/httphttp-fastifyPool-based controller discovery with framework-owned decorators
CLI@modularityjs/clicli-commanderPool-based command discovery with Commander.js

Infrastructure

PackageDescription
@modularityjs/redisShared ioredis client for all Redis drivers
@modularityjs/configScoped configuration with pluggable sources
@modularityjs/config-envEnvironment variable config source
@modularityjs/databaseTypeORM integration with entity pools
@modularityjs/deployment-configStatic per-module deployment configuration

Extensions

PackageDescription
@modularityjs/eventsDomain event bus with listener pools
@modularityjs/schedulerCron-based job scheduler with distributed locking
@modularityjs/healthHealth check indicators
@modularityjs/scopeScope chain resolver for multi-tenant contexts
@modularityjs/exceptionStructured exception hierarchy

Facades

PackageDescription
@modularityjs/coreRe-exports all framework APIs for app developers
@modularityjs/core-cliRe-exports all CLI modules

App developers should import from @modularityjs/core for framework APIs and directly from driver packages for specific drivers.