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

@nuov.io/error-handling

v1.1.58

Published

The @nuov.io error handling library.

Readme

Error Handling

Description

Error Handling is a TypeScript module that provides a structured approach to error handling in applications. It builds on top of @nuov.io/error-handler and offers an abstract singleton service (ErrorHandlingService) for managing application-wide error handling, a ready-to-use ThrowErrorHandler that re-throws errors, and an ErrorHandling interface for dependency injection. It is designed to be extended by concrete implementations and serves as the error handling layer for the @nuov.io ecosystem.

Installation

npm install @nuov.io/error-handling

Usage

Using ThrowErrorHandler

ThrowErrorHandler is a concrete error handler that simply re-throws any error passed to it. It is useful as a default handler or in testing scenarios.

import { ThrowErrorHandler } from '@nuov.io/error-handling';

const handler = new ThrowErrorHandler();
handler.handleError(new Error('This error will be re-thrown'));

Extending ErrorHandlingService

ErrorHandlingService is an abstract singleton base class. Extend it to create a custom error handling service, initialize it once at application startup, and access the instance anywhere via the static instance getter.

import { ErrorHandlingService } from '@nuov.io/error-handling';

class AnErrorHandlingService extends ErrorHandlingService<AnErrorHandlingService> {
  private constructor() {
    super();
  }

  public static initialize(): void {
    const anErrorHandlingService: AnErrorHandlingService =
      new AnErrorHandlingService();
    anErrorHandlingService.initialize(anErrorHandlingService);
  }

  public override handleError(error: unknown): void {
    // Custom error handling logic here
  }
}

// Initialize once at startup
AnErrorHandlingService.initialize();

Using ErrorHandlingService

import { ErrorHandlingService } from '@nuov.io/error-handling';

class MyService {
  public doWork(): void {
    try {
      // ... work ...
    } catch (error) {
      // Access the singleton instance anywhere
      ErrorHandlingService.instance.handleError(error);
    }
  }
}

Re-exported types

This package also re-exports ErrorHandler and ErrorHandlerPrototype from @nuov.io/error-handler for convenience.

import { ErrorHandler, ErrorHandlerPrototype } from '@nuov.io/error-handling';

API Reference

ErrorHandling (interface)

A contract for classes that expose an error handler.

| Property | Type | Description | | ----------------------- | -------------- | --------------------------- | | readonly errorHandler | ErrorHandler | The error handler instance. |

ErrorHandlingService<T> (abstract class)

An abstract singleton base class for application-wide error handling services.

Static Properties

| Property | Type | Description | | --------------- | -------------- | ------------------------------------------------------------------- | | instance | ErrorHandler | Returns the singleton instance. Throws an error if not initialized. | | isInitialized | boolean | Returns true if the service has been initialized. |

Protected Methods

| Method | Returns | Description | | ------------------------------------- | ------- | -------------------------------------------------------------------- | | initialize(errorHandlingService: T) | void | Sets the singleton instance. Throws an error if already initialized. |

Abstract Methods

| Method | Returns | Description | | ----------------------------- | ------- | ----------------------------------------------------- | | handleError(error: unknown) | void | Handles the error. Must be implemented by subclasses. |

ThrowErrorHandler (class)

A concrete error handler that re-throws any error passed to it. Extends ErrorHandlerPrototype.

Constructor

new ThrowErrorHandler();

Methods

| Method | Returns | Description | | ----------------------------- | ------- | ----------------------------- | | handleError(error: unknown) | void | Re-throws the provided error. |

Features

  • Singleton patternErrorHandlingService enforces a single, application-wide error handler
  • Dependency injection readyErrorHandling interface decouples consumers from concrete implementations
  • Ready-to-use handlerThrowErrorHandler provides a zero-config handler that re-throws errors
  • Extensible — designed to be subclassed for custom error handling strategies (logging, reporting, etc.)
  • TypeScript-first — full type definitions included
  • ESM-only — distributed as an ES module

License

MIT License