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

@dws-std/error

v2.0.0

Published

Structured TypeScript exceptions with UUID v7 tracking, HTTP status codes, and automatic timestamps.

Readme

🐞 DWS Error

If you've ever debugged a production incident with nothing but a generic Error("something went wrong"), you know the pain.
This package gives your errors structure, every exception carries a UUID v7, a timestamp, and an optional HTTP status code, so you can always trace what happened and when.

Why this package?

Vanilla Error objects lack context.
You end up manually adding IDs, timestamps, and status codes everywhere, or worse, you don't, and debugging becomes a guessing game.

@dws-std/error solves that with two classes:

  • Exception - a richer base error with automatic UUID v7 tracking, timestamps, and an optional error code.
  • HttpException - extends Exception with an HTTP status code, perfect for API error responses.

No dependencies, no bloat. Just structured errors that make your life easier.

📌 Table of Contents

✨ Features

  • 🔍 UUID v7 Tracking : Every exception gets a unique, time-sortable ID out of the box.
  • 📅 Built-in Context : Timestamp, error code, and cause are baked into each instance.
  • 🌐 HTTP-Aware : HttpException maps to any standard HTTP status for clean API responses.
  • 📦 Zero Dependencies : Pure TypeScript, tiny footprint.

🔧 Installation

bun add @dws-std/error

⚙️ Usage

Exception - General-Purpose Errors

Use Exception whenever you need a traceable error with more context than a plain Error.

import { Exception } from '@dws-std/error';

throw new Exception('Configuration file not found', {
	code: 'CONFIG_NOT_FOUND'
});

Every instance automatically carries a uuid and a date, so you can correlate it in your logs without any extra work.

You can also wrap a root cause to preserve the original error:

import { Exception } from '@dws-std/error';

try {
	await db.save(user);
} catch (err) {
	throw new Exception('Failed to persist user', { cause: err });
}

HttpException - API Errors

When you're building an API and need an error tied to an HTTP status code, reach for HttpException.
Pass a status key like 'BAD_REQUEST' or a numeric code like 400, both work.

import { HttpException } from '@dws-std/error';

throw new HttpException('Invalid email address', {
	status: 'BAD_REQUEST',
	code: 'INVALID_EMAIL'
});

If you don't specify a status, it defaults to 500 Internal Server Error, so unexpected failures are covered too:

import { HttpException } from '@dws-std/error';

throw new HttpException('Something broke');

📚 API Reference

Full docs: Dominus-Web-Service.github.io/packages

⚖️ License

MIT - Feel free to use it.

📧 Contact