# api-response-formate

> Rest api standard response format

Latest version **1.0.4** (published 2021-01-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install api-response-formate
pnpm add api-response-formate
yarn add api-response-formate
bun add api-response-formate
```

## 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.4 |
| Published | 2021-01-20 |
| First published | 2021-01-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chanti |
| Maintainers | namenotfound |
| Keywords | api, reponse, respose, formate, respose, stucture, API response, response format |

## Links

- npm: https://www.npmjs.com/package/api-response-formate
- npm.io page: https://npm.io/package/api-response-formate

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-01-20
- 1.0.3 — 2021-01-19
- 1.0.2 — 2021-01-19
- 1.0.1 — 2021-01-19
- 1.0.0 — 2021-01-19

## README

## api-response-formate

api-response-formate is for simple and standard api response

## Install

    npm install api-response-formate

- `res` - res: Response
- `code` - Response status code.
- `data` - response data
- `message` - Message
- `error` - error object

```js

cosnt response =require('api-response-formate');

cosnt test=(req,res,next)=>{
    try{

        return response(res,200,'my data','success',null)
         /**
          API response will be --
          {code: 200, data:'my data' ,message:'succsess',error:null}

         */
    }catch(error){

        return response(res,402,null,'Something went wrong..!',error);
        /**
           API response will be --
           {code: 402, data:null,message:'Something went wrong..!',error: error object}
         */
    }

}

module.exports=test

```

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