1.1.4 • Published 2 years ago

proses-response v1.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Proses response handlers

Internal lib for handling express response

Usage

import {success} from "proses-response";
//res should be express response object;
success(res, data, msg);
other(res, msg)

Register an error logger to record server error

import {responseHandler} from "proses-response";
responseHandler.registerLoggers({
    err: myCustomFunction
})

this will emit the error handled by server error.

Send encrypted response to client

const encryptResponse = (data:any) => {
   //encrypt data
   return data
}
import {responseHandler} from "proses-response";
responseHandler.registerEncryption(encryptResponse)

specify dialect for foreign key checks

import {responseHandler} from "proses-response";
responseHandler.registerDialect('mssql')

For handling foreign key checks.

Contributing

Any changes or suggestions are welcome. Please discuss the changes before hand.

Please make sure to use types where applicable to avoid wring config.

1.1.4

2 years ago

1.1.3

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago