@vyhoang/microservice-clean
v1.0.6
Published
Shared TypeScript utilities and infrastructure helpers for backend services.
Downloads
39
Maintainers
Readme
@vyhoang/microservice-clean
Shared backend utilities and infrastructure helpers for Node.js microservices.
This package is intentionally exposed through subpath imports only.
Installation
npm install @vyhoang/microservice-cleanSome features depend on framework-specific packages such as NestJS, Moleculer, Mongoose, Redis, or Elasticsearch. Those are declared as optional peer dependencies, so only install the ones your app actually uses.
Import Rules
Use one of these two entrypoints:
import { ResponseHandler, Exception, validateDto } from "@vyhoang/microservice-clean/core";
import { RedisService, RabbitMQEventBus } from "@vyhoang/microservice-clean/infrastructure";Do not import from:
import { ... } from "@vyhoang/microservice-clean";Root package import is intentionally not supported.
Included Modules
core
- Constants and exception helpers
- Shared interfaces
- Response helpers
- Utility functions such as DTO validation and ID generation
infrastructure
- Redis cache helpers
- SMS providers and fallback handling
- RabbitMQ event bus
- Logger and Elasticsearch stream helpers
- Moleculer language and mixin helpers
- Repository and mapper base classes
Build
npm run buildProject Structure
src/
core/
infrastructure/
dist/Requirements
- Node.js
>=20
License
ISC
