success-failed-message
v1.0.6
Published
Success and failed reply message
Downloads
4
Maintainers
Readme
To install the package
npm i --save success-failed-message
Usage
const reply = require("success-failed-message")
reply.failed(res, "Something went wrong. Try again!");
reply.success(res, "Data fetched successfully");
The Failed parameters
Parameters | Type | Description
res | Function | Function Response form the express
message | string, text | Any type of message (must be text or string)
The Success parameters
Parameters | Type | Default | Description
res | Function | N/A | Function Response form the express
message | string, text | N/A | Any type of message (must be text or string)
data | Array, object | null | Send the data from user end
pagination | Boolean | false | For dynamic pagination value send to the frontend (default: 20)
title | string, text | "" | Title for the success message
extra | Array | [] | Extra is an array with the key or values you want to send