New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tenant-app-shared-functions

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

tenant-app-shared-functions

this package contains all the functions shared by services in tenant-app

latest
Source
npmnpm
Version
6.3.0
Version published
Maintainers
3
Created
Source

tenant-app-shared-functions

This package content all functions that is used across services in tenant app

Installation

To install, run the code below:

npm install tenant-app-shared-functions

Functions

  • okHttpResponse:
    This is use to send ok http response to the client after an operation.
    syntax
    okHttpResponse(res, response, message='success')
    note: res is the express response object while response is the response you want to send to the client.

  • errorResponse:
    This is use to send Not_found http response to the client after an operation.
    syntax
    errorResponse(res, message)
    note: res is the express response object while message is the message you want to send to the client about the error.

Example 1:

(req, res) => {
    try {
        doSomething();
        okHttpResponse(res, response);
    }
    catch (e) {
        errorResponse(res, e.message)
    }
}

Example 2:

(req, res) => {
    try {
        doSomething();
        okHttpResponse(
            res,
            response,
            'operation was successful'
        );
    }
    catch (e) {
        errorResponse(res, e.message)
    }
}

Keywords

user

FAQs

Package last updated on 10 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts