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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@slickteam/nestjs-utils

v1.4.1

Published

Utils functions and classes for Nestjs

Readme

Slick NestJS Utils

npm version License: MIT

Utility functions for NestJS applications, providing logging decorators and error handling helpers.

Installation

npm install @slickteam/nestjs-utils

API Reference

LoggerParams

Method decorator that automatically logs function parameters when called.

import { LoggerParams } from '@slickteam/nestjs-utils';

class UserService {
  @LoggerParams() // Default: 'verbose' level
  findUser(id: string, options: object) {
    // Logs: "findUser([0]=123,[1]={...})" at verbose level
  }

  @LoggerParams('debug')
  createUser(name: string) {
    // Logs: "createUser([0]="John")" at debug level
  }

  @LoggerParams({
    level: 'debug',
    paramNames: ['userId', 'userData'],
  })
  updateUser(id: string, data: object) {
    // Logs: "updateUser(userId="123", userData={...})" at debug level
  }
}

Parameters:

  • level (optional): Log level - 'verbose' | 'debug' | 'log' | 'warn' | 'error'. Default: 'verbose'
  • paramNames (optional): Array of parameter names to use instead of indices. If provided, must match the number of parameters.

Note: You can pass either a string for the log level, or an options object with level and paramNames properties.

throwErrorAndLog

Throws an HttpException and logs the error message.

import { HttpStatus, Logger } from '@nestjs/common';
import { throwErrorAndLog } from '@slickteam/nestjs-utils';

class UserService {
  private readonly logger = new Logger(UserService.name);

  findUser(id: string) {
    const user = this.repository.find(id);
    if (!user) {
      throwErrorAndLog('User not found', HttpStatus.NOT_FOUND, this.logger);
    }
    return user;
  }
}

Parameters:

  • message: Error message to log and throw
  • typeError (optional): HTTP status code. Default: HttpStatus.INTERNAL_SERVER_ERROR
  • logger (optional): Logger instance. If not provided, uses the static Logger

throwErrorAndLogWithContext

Throws an HttpException and logs the error message with a context string.

import { HttpStatus } from '@nestjs/common';
import { throwErrorAndLogWithContext } from '@slickteam/nestjs-utils';

function validateInput(data: unknown) {
  if (!data) {
    throwErrorAndLogWithContext('Invalid input', HttpStatus.BAD_REQUEST, 'ValidationService');
  }
}

Parameters:

  • message: Error message to log and throw
  • typeError (optional): HTTP status code. Default: HttpStatus.INTERNAL_SERVER_ERROR
  • context (optional): Context string for the logger

logLevel

Returns an array of log levels to enable, based on a minimum level (cascade).

import { logLevel } from '@slickteam/nestjs-utils';

// Returns ['debug', 'log', 'warn', 'error']
const levels = logLevel('debug');

// Usage with NestJS bootstrap
const app = await NestFactory.create(AppModule, {
  logger: logLevel('debug'),
});

Parameters:

  • level: Minimum log level - 'verbose' | 'debug' | 'log' | 'warn' | 'error'

Returns: Array of LogLevel including the specified level and all levels above it.

Requirements

  • Node.js >= 18
  • NestJS >= 11

License

MIT