Skip to content

@domusjs/security - Introduction

The DomusJS Security Module provides essential security primitives such as password hashing and rate limiting. It’s designed to be plug-and-play with extensibility in mind, so you can swap implementations while preserving a unified interface.


  • Hashing Service: Built on top of a Hasher interface. The default implementation uses bcrypt.
  • Rate Limiter: Abstracts rate-limiting logic. Includes:
    • ✅ In-memory implementation for local environments.
    • ✅ Redis-based implementation for distributed rate limiting.
  • Express Middleware: Plug-and-play rate limiting with Express apps using the provided rateLimitMiddleware.

You can easily provide your own implementations for Hasher or RateLimiter by registering them via the DI container or inside your own registerSecurityModule() setup.