1.1.3 • Published 2 years ago

@pacyl2k19/ekshhot-common-helpers v1.1.3

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

EKSHOT COMMON HELPERS

Ths NPM package contains common logic shared among backend micriservices, thid includes:

  • Token logic
  • Api Response handler
  • Middlewares and Guards

Usage

  1. Install then import the package
        // Install
        yarn add @ekshot/ekshhot-common-helpers
        // Import
        import { apiResponse, tokenHelper, JaHttpStatusCode } from '@ekshhot/ekshhot-common-helpers'
  2. Then use them like
    return new ApiResponse(
          JaHttpStatusCode.BAD_REQUEST, // the response status
          "A message",
          true, // If the request succeed
          {}, // The data to send to the client
          errors.array() // if any error
        ).sendResponse(res);