Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amaui-org/amaui-errors

Errors
https://github.com/amaui-org/amaui-errors

amaui back-end backend browser error errors front-end frontend javascript js library node nodejs typescript web

Last synced: about 2 months ago
JSON representation

Errors

Awesome Lists containing this project

README

        



amaui logo

amaui Errors


Errors



MIT license    
Production ready    
UMD 0.8kb gzipped    
100% test cov    
Browser and Nodejs


Very simple code    
Modern code    
Junior friendly    
Typescript    
Made with :yellow_heart:


## Getting started

### Add

```sh
yarn add @amaui/errors
```

### Use

```javascript
import { AmauiError } from '@amaui/errors';
import AmauiLog from '@amaui/log';

const amauiError = new AmauiError('a');

amauiError.name;
amauiError.message;
amauiError.added_at;
amauiError.stack;

// AmauiError
// 'a'
// 1643893234
// 'AmauiError: a\n at eval (eval at evaluate (:3:2389), :2:31)\n at t.default.evaluate (:3:2412)\n at t.default. (:1:44)'

AmauiLog.error(amauiError);

// Output

// 04-04-2014 04:04:14.141 (error):

// a

// AmauiError: a
// at eval (eval at evaluate (:3:2389), :2:31)
// at t.default.evaluate (:3:2412)
// at t.default. (:1:44)

```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```