resp-express

2.0.4 • Public • Published

Resp Express

CI CI codecov License: MIT npm npm bundle size (version) GitHub repo size

Install

npm install resp-express

or

yarn add resp-express

How to imports

import resp from "resp-express";

or;

const resp = require("resp-express");

How to use

app.get("/", function(req, res) {
  resp.returnSucessMessage(res, "Sucess !!");
});
// return object code 200 and object {ok: "Sucess !!"}

app.get("/", function(req, res) {
  resp.returnSucessObject(res, { text: "Sucess !!" });
});
/* return object code 200 and object 
{text: "Sucess !!"} 
*/

app.get("/", function(req, res) {
  resp.returnErrorMessage(res, "Error !!");
});
// return object code 200 and object {ok: "Error !!"}

app.get("/", function(req, res) {
  resp.returnErrorObject(res, { text: "Error !!" });
});
/* return object code 200 and object 
{text: "Error !!"} 
*/

Package Sidebar

Install

npm i resp-express

Weekly Downloads

0

Version

2.0.4

License

MIT

Unpacked Size

8.46 kB

Total Files

5

Last publish

Collaborators

  • joaomede