Package Exports
- @daisugi/ayamari
- @daisugi/ayamari/src
Readme
@daisugi/ayamari
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
๐ 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