Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/onesy-me/errors
- Owner: onesy-me
- License: mit
- Created: 2022-02-03T12:51:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T20:30:19.000Z (23 days ago)
- Last Synced: 2024-12-11T20:36:27.265Z (23 days ago)
- Topics: amaui, back-end, backend, browser, error, errors, front-end, frontend, javascript, js, library, node, nodejs, typescript, web
- Language: TypeScript
- Homepage: https://docs.onesy.me/library/errors
- Size: 187 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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
```