engrcommonmodule
TypeScript icon, indicating that this package has built-in type declarations

1.0.50 • Public • Published

Common Functionalities

This project has a common functionalities for Kinara Engineering Applications. It has the functionalities like DataModels and the Common Utilities which includes Database Connectivity, Check Auth using JWT Token, Logging the Request and Response, and a Common Response for the API's.

GitLab Repository Link

Get the Code

$ git clone https://gitlab.com/kinaraengineering/common.git

$ npm install

Build the application

Build command is used to compile the typescript files to javascript files so the end user access the functionalities.

$ npm run build

Publish NPM package

Before publishing the package, compile the *.ts files using the build command and check the publish version number (increment it by one to that of previous published version). And run below commands to publish the package on NPM:

Step1: Login to the NPM server in the local system. It will ask to enter the details for username and password.

$ npm login

Step 2: Confirm on the logged in user with the below command.

$ npm whoami

Step 3: Publish the code with below command.

$ npm publish

Installation

This is a Node.js module available through the npm registry.

Installation is done using the npm install command:

$ npm install engrcommonmodule

Features

  • Data Models - These are ORM-based data models using Sequelizer, they have a structure of the database tables.
  • Utilities - These are the basic common functionalities that are required for any packages. And each functionality is as follows:
    • dbConfig - his file is used to establish a connection to a database. The values are being fetched from the environment file. SERVER_TYPE field can be True or False. If the value is False, it will allow connection to an external database like RDS.
    • check-auth - This file is used to authenticate the incoming requests based using JWT Token.
    • addAPIHist - This file logs the APIs Request and Response to the database table.
    • loggers - This file is used to console the logs.
    • response - This file is a success or failure response for API Requests.

Package Sidebar

Install

npm i engrcommonmodule

Weekly Downloads

0

Version

1.0.50

License

ISC

Unpacked Size

204 kB

Total Files

53

Last publish

Collaborators

  • vikascm