# tiny-errors

> Simple error class for your REST server # Installation `$ npm install --save tiny-errors` # Usage # Properties - [code](#code) - [message](#message) ## code ```javascript code: number ``` This code will be used as HTTP Status (200, 404, 403, 500...) ## me

Latest version **1.0.5** (published 2017-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-errors
pnpm add tiny-errors
yarn add tiny-errors
bun add tiny-errors
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2017-10-25 |
| First published | 2017-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | tinyRush |
| Maintainers | hungnm2904, tinyrush |

## Links

- npm: https://www.npmjs.com/package/tiny-errors
- Repository: https://github.com/tinyRush/tiny-errors
- Homepage: https://github.com/tinyRush/tiny-errors#readme
- Issues: https://github.com/tinyRush/tiny-errors/issues
- npm.io page: https://npm.io/package/tiny-errors

## Recent versions

- 1.0.5 (latest) — 2017-10-25
- 1.0.4 — 2017-10-19
- 1.0.3 — 2017-10-18
- 1.0.2 — 2017-09-18
- 1.0.1 — 2017-09-12
- 1.0.0 — 2017-09-12

## README

# tiny-errors
Simple error class for your REST server
# Installation
`$ npm install --save tiny-errors`
# Usage
# Properties
- [code](#code)
- [message](#message)
## code
```javascript
code: number
```
This code will be used as HTTP Status (200, 404, 403, 500...)
## message
```javascript
message: string
```
This message will be use to send to client
# Methods
- [constructor](#constructor)
- [parse](#parse)
## constructor
```javascript
constructor(code: number, message: string) {...}

// Example
let error = new TinyErrors(400, 'Username "tinyRush" is duplicated')
```
## parse
```javascript
public static parse(error): TinyError {...}

// Example
// This method usually use to parse mongoose error to error with appropriate code (HTTP Status)
let error = TinyErrors.parse(mongooseValidationError);
```
# License
[MIT](https://github.com/tinyRush/tiny-errors/blob/master/LICENSE)

---
_Source: https://npm.io/package/tiny-errors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
