npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

zola-nestjs-shared

v0.1.9

Published

zola-nestjs-shared is a shared package for NestJS applications

Readme

zola-nestjs-shared

A shared package for NestJS applications providing common utilities, modules, and services.

Installation

Standard Installation

npm install zola-nestjs-shared

Known Issue: nestjs-minio-client Postinstall Script

If you encounter an error during installation related to husky not being found:

npm error 'husky' is not recognized as an internal or external command

This is caused by the nestjs-minio-client dependency having a problematic postinstall script. To work around this, install with the --ignore-scripts flag:

npm install zola-nestjs-shared --ignore-scripts

Note: This will skip all postinstall scripts, including the problematic one from nestjs-minio-client. The package will still function correctly as the postinstall script is only for setting up git hooks in the nestjs-minio-client repository itself, not required for runtime functionality.

Alternative: Install Husky in Your Project

If you prefer not to use --ignore-scripts, you can install husky as a dev dependency in your consuming project:

npm install --save-dev husky
npm install zola-nestjs-shared

However, this is not recommended as it adds an unnecessary dependency to your project.

Peer Dependencies

This package requires the following peer dependencies to be installed in your consuming project:

  • @nestjs/common: ^10.0.0 || ^11.0.0
  • @nestjs/core: ^10.0.0 || ^11.0.0
  • @nestjs/config: ^3.0.0 || ^4.0.0
  • @nestjs/jwt: ^10.0.0 || ^11.0.0
  • @nestjs/passport: ^10.0.0 || ^11.0.0
  • @nestjs/platform-express: ^10.0.0 || ^11.0.0
  • reflect-metadata: ^0.1.0 || ^0.2.0
  • rxjs: ^7.0.0 || ^8.0.0

Optional peer dependencies (only needed if using specific features):

  • @nestjs/schedule: ^4.0.0 || ^5.0.0 || ^6.0.0 (for scheduling features)
  • @nestjs/swagger: ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 (for Swagger/OpenAPI)
  • @nestjs/throttler: ^5.0.0 || ^6.0.0 (for rate limiting)
  • @nestjs/microservices: ^10.0.0 || ^11.0.0 (for microservices)
  • amqplib: ^0.10.0 (required only if using audit features with RabbitMQ)
  • @nestjs/typeorm: ^10.0.0 || ^11.0.0 (for TypeORM features)
  • typeorm: ^0.3.0 (for TypeORM features)

Using Audit Features

Important: You can use this package without amqplib even if you import AuditModule. The module will automatically detect if dependencies are available and only enable audit features if both @nestjs/microservices and amqplib are installed.

The amqplib dependency is only required when you want to actually use audit logging features:

  1. Importing AuditModule - This is now safe even without amqplib:

    import { AuditModule } from 'zola-nestjs-shared';
       
    @Module({
      imports: [AuditModule], // ✅ Safe - will work without amqplib (audit features will be disabled)
    })
  2. Using audit decorators or interceptors - These will only work if dependencies are installed:

    import { AuditLoggerInterceptor } from 'zola-nestjs-shared';
    import { AUDIT_RMQ_EVENT } from 'zola-nestjs-shared';

If you plan to use the audit logging features (which use RabbitMQ), you must install both @nestjs/microservices and amqplib:

npm install @nestjs/microservices amqplib

Note: The audit module uses RabbitMQ (Transport.RMQ) for event logging. The module will automatically check if amqplib and @nestjs/microservices are available:

  • If both are installed: Audit features will be enabled and work normally
  • If either is missing: The module will load successfully but audit features will be disabled (you'll see a warning in development mode)

You can safely import AuditModule without amqplib - the package will work correctly for all other features, and audit features will simply be disabled.

Usage

import { Module } from '@nestjs/common';
import { AuthorizationModule } from 'zola-nestjs-shared';

@Module({
  imports: [AuthorizationModule],
})
export class AppModule {}

License

ISC