zeny-nestjs-packages
v1.0.5
Published
Zeny NestJS packages
Downloads
8
Readme
nestjs-libs
Reusable NestJS building blocks that wrap common infrastructure concerns used across Zeny services. The package exposes cache, database, encryption, file handling, mail delivery, OTP, push notification, queues, throttling, and other utilities through @nestjs-friendly modules and helpers.
Installation
npm install nestjs-libsThe package ships precompiled JavaScript in dist/ plus TypeScript declarations, so it can be consumed from either JavaScript or TypeScript projects.
Quick start
import { CacheModule } from '@nestjs/cache-manager';
import { CacheService, DatabaseModule } from 'nestjs-libs';
@Module({
imports: [
CacheModule.register(),
DatabaseModule.register({
dialect: 'postgres',
database: process.env.DB_NAME,
host: process.env.DB_HOST,
username: process.env.DB_USER,
password: process.env.DB_PASS,
}),
],
providers: [CacheService],
})
export class AppModule {}Modules are designed to plug into an existing NestJS application with minimal configuration. Refer to the exports in src/index.ts for additional services and helpers that can be imported directly.
Provided features
- Cache – Redis-backed cache module and service helpers under
drivers/cache. - Database – Sequelize-based database integration (helpers, repositories, entities) under
drivers/database. - Encryption – JWT utilities, password hashing, and Snap signature helpers in
drivers/encryption. - File management – S3/MinIO drivers, CSV and Excel helpers, and abstractions under
drivers/files. - Mail – Configurable mail module, processor, and service in
drivers/mail. - OTP & Security – OTP drivers (email, Fazpass), throttling support, reCAPTCHA helpers, and TOTP utilities.
- Queues & Notifications – Bull queue helpers and push notification contracts/services.
- Common utilities – Data transfer objects, interceptors, pipes, exceptions, and helper functions for date/time, randomization, validation, and more.
Each folder under src/ exposes TypeScript types and services that can be imported individually if you prefer not to load entire modules.
Scripts
npm run build– Compile the TypeScript sources viatscinto thedist/directory.npm run test– Execute the Jest test suite.
Contributing
- Install dependencies with
npm install. - Run
npm run buildto compile ornpm run testto execute tests. - Open a pull request describing the changes and the affected modules.
License
ISC © zeny-team
