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

@pesalink/response-utils-package

v1.2.14

Published

A shared response utils package that provides api response functions and integrates request and response logging

Readme

PesaLink Logger The PesaLink Logger package provides utilities to enhance logging capabilities for your Node.js applications. It allows you to log method calls dynamically for class prototypes and supports advanced logging strategies such as AOP (Aspect-Oriented Programming). This package includes two main components: AOPLogger and AOPLoggerUtils.

Features Dynamic Logging: Log all method calls on a class prototype. Exclusion Support: Exclude specific methods from being logged. Error-Only Logging: Configure methods to log only errors. Custom Advice Types: Choose the logging strategy (around, before, after). Utility-Driven Approach: Use either AOPLogger directly or the AOPLoggerUtils method logMethodsWithAOP. Installation Install the package using npm:

bash Copy code npm install pesalink-logger Usage

  1. Using AOPLogger Directly AOPLogger is the core utility to log individual method calls on a class prototype. You can call it directly to configure logging for specific methods.

javascript Copy code const AOPLogger = require("pesalink-logger/aopLogger");

AOPLogger.logMethodCall( classPrototype, // The class prototype methodName, // Name of the method to log className, // Name of the class methodType, // Optional: Type of method (e.g., "getAll" for error logging) adviceType, // Optional: Type of advice (default: "around") classType // Optional: Class type for custom logging ); 2. Using AOPLoggerUtils.logMethodsWithAOP The logMethodsWithAOP method in AOPLoggerUtils simplifies logging for all methods in a class prototype, with options to exclude specific methods or log errors only for some.

javascript Copy code const { logMethodsWithAOP } = require("pesalink-logger/aopLoggerUtils");

logMethodsWithAOP( classPrototype, // Prototype of the class excludedMethods = [], // Methods to exclude from logging logErrorsOnly = [], // Methods to log only errors (e.g., "getAll") className, // Name of the class for logging context classType, // Optional: Class type for custom strategies adviceType = "around" // Optional: Advice type (default: "around") );

Parameters for logMethodsWithAOP

Parameter Description classPrototype The prototype of the class whose methods you want to log. excludedMethods Array of method names to exclude from logging. logErrorsOnly Array of methods for which only errors should be logged (e.g., getAll). className The name of the class (used for logging context). classType The type of the class (optional, used in custom logging strategies). adviceType The type of advice (optional, default is "around" for method execution). Example: Dynamic Logging Below is an example demonstrating the use of AOPLoggerUtils to log method calls dynamically on a class:

const { logMethodsWithAOP } = require("pesalink-logger/aopLoggerUtils");

class MyService {
  constructor() {}

  fetchData() {
    console.log("Fetching data...");
  }

  saveData() {
    console.log("Saving data...");
  }

  getAll() {
    throw new Error("An error occurred while fetching all data!");
  }
}

// Exclude `saveData` and log only errors for `getAll`
logMethodsWithAOP(
  MyService.prototype,
  ["saveData"],        // Excluded methods
  ["getAll"],          // Log errors only
  "MyService"          // Class name
);

// Instantiate and test logging
const service = new MyService();
service.fetchData();
try {
  service.getAll();
} catch (error) {}

``Integration Notes The AOPLogger class provides the low-level API for method call logging. The AOPLoggerUtils.logMethodsWithAOP method wraps around AOPLogger to simplify configuration for dynamic logging of class prototypes. Both utilities are included in the pesalink-logger package and can be used interchangeably based on your project needs.