npm.io
0.6.2 • Published 1 year ago

@daisugi/ayamari

Licence
MIT
Version
0.6.2
Deps
1
Size
40 kB
Vulns
0
Weekly
0
Stars
22

@daisugi/ayamari

version npm downloads bundlephobia

This project is part of the @daisugi monorepo.

Ayamari helps you to create rich errors in a simple and consistent way.


Features

  • Minimal size overhead (details)
  • ️ Written in TypeScript
  • Uses only trusted dependencies
  • Powerful and agnostic to your code
  • Well-tested
  • Used in production
  • Supports both ES Modules and CommonJS

Usage

import { Ayamari } from '@daisugi/ayamari';

const { errFn } = new Ayamari();

try {
  eval('{');
} catch (err) {
  errFn.UnexpectedError('Something went wrong.', {
    cause: err,
  });
}

Table of Contents


Installation

Using npm:

npm install @daisugi/ayamari

Using pnpm:

pnpm install @daisugi/ayamari

Back to top


Overview

Ayamari improves error handling by simplifying the creation of rich, contextual errors. It enhances the legibility of exception output and provides useful features such as:

  • No stack generation by default (for performance)
  • Chained causes
  • Additional properties for extra context
  • Custom errors
  • Pretty stack traces
  • Error levels for categorization

Other Projects

Meet the ecosystem

Back to top


License

MIT