Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/onesy-me/errors

Errors
https://github.com/onesy-me/errors

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

Last synced: 10 days ago
JSON representation

Errors

Awesome Lists containing this project

README

        



onesy logo

onesy 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 @onesy/errors
```

### Use

```javascript
import { OnesyError } from '@onesy/errors';
import OnesyLog from '@onesy/log';

const onesyError = new OnesyError('a');

onesyError.name;
onesyError.message;
onesyError.added_at;
onesyError.stack;

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

OnesyLog.error(onesyError);

// Output

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

// a

// OnesyError: 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
```