@daisugi/ayamari
v0.4.0
Published
Ayamari helps you to create rich errors in a simple and consistent way.
Downloads
106
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
- 💡 Minimum size overhead.
- ⚡️ Written in TypeScript.
- 📦 Only uses trusted dependencies.
- 🔨 Powerful and agnostic to your code.
- 🧪 Well tested.
- 🤝 Is used in production.
- ⚡️ Exports ES Modules as well as 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
Install
Using npm:
npm install @daisugi/ayamari
Using yarn:
yarn add @daisugi/ayamari
Overview
Ayamari improves error handling for developers by simplifying the process and making it more manageable. It achieves this by enhancing the legibility of exception output and providing contextual rich errors with causes. The library includes several useful features:
- ✅ By default,
no stack
is generated for performance improvement. - ✅ Chains of causes.
- ✅ Properties to provide extra information about the error.
- ✅ Custom errors.
- ✅ Pretty stack traces.
- ✅ Levels for categorizing errors.