Legacy assertion mode in Node Js

Legacy assertion mode uses the == operator in: assert.deepEqual() assert.equal() assert.notDeepEqual() assert.notEqual() To use legacy assertion mode: const assert = require(‘node:assert’); copy Legacy assertion mode may have surprising results, especially when using assert.deepEqual(): // WARNING: This does not throw an AssertionError in legacy assertion mode! assert.deepEqual(/a/gi, new Date());

Resolving the “ENOENT: No Such File or Directory” Error in Gulp Tasks

When working with Gulp, you may encounter the error: Error: ENOENT: no such file or directory, scandir ‘C:UsersHPDownloadsSuiteCommerce AdvancedsuitecommerceLocalDistributionAdvancedprocessed-templates’ This error typically indicates that Gulp is trying to access a directory that does not exist. Here’s a detailed guide on how to resolve this issue effectively. Step 1: Verify the Specified Directory The first step… Continue reading Resolving the “ENOENT: No Such File or Directory” Error in Gulp Tasks

Advantages of SuiteCloud Unit Testing with npm and Node.js

SuiteCloud Unit Testing is a powerful tool for NetSuite developers, offering a streamlined way to ensure the reliability and performance of SuiteScript 2.x code. By leveraging npm and Node.js, developers can easily integrate unit testing into their SuiteCloud projects, taking advantage of the following benefits: Enhanced Code Quality: Unit tests help catch bugs early in… Continue reading Advantages of SuiteCloud Unit Testing with npm and Node.js

7 Node.js Design Patterns Every Developer Should Know

Explore the Facade, Adapter, Singleton, Prototype, Builder, Proxy and Factory for modern software design. Design patterns are needed to solve every-day software design problems. This could be problems like: Maintaining database connections Creating and managing objects Notifying a set of users subscribed to a particular entity. If you try to come up with a solution… Continue reading 7 Node.js Design Patterns Every Developer Should Know

Encryption and Decryption Logic for ICICI bank Apis

PFB & PFA Kindly start the live testing and let us know incase of any support is required from bank end   Headers :-   accept: */*,  content-length: 684, content-type: text/plain   APIKEY: ADGpGADpJjzvsBDrKT07beqVo6IIsOuK “AGGRID”:”OTOE0832″ “AGGRNAME”:”G10XTECH” “URN”:”SR256689761 APIs:- https://apibankingone.icicibank.com/api/Corporate/CIB/v1/AccountStatement https://apibankingone.icicibank.com/api/Corporate/CIB/v1/BalanceInquiry   Encryption & Decryption:- AES-128-CBC Algorithm Name: RSA Mode: ECB Padding: PKCS1Padding RSA/ECB/PKCS1Padding Encryption Logic:-… Continue reading Encryption and Decryption Logic for ICICI bank Apis

Hybrid decryption using node js

Here is an example of the decryption function which can be used for the decryption of the encrypted data const encryptedKey1 = fs.readFileSync( path.resolve(__dirname, “../../../../keys/encryptkey.txt”), “utf8”); const EN_PATH = path.resolve(__dirname, “../../../../keys/encrypt.txt”); const EN_KEY = fs.readFileSync(EN_PATH, “utf8”); var key = await mycrypto.decryptViaPrivateKey(encryptedKey1, GTEN_PRIKEY_PATH, PASS); const aescbc = new aesjs.ModeOfOperation.cbc(aesjs.utils.utf8.toBytes(key), “”); let _decryptedText = aescbc.decrypt(Buffer.from(EN_KEY, “base64”)); _decryptedText… Continue reading Hybrid decryption using node js

Node Js App to call back an API

Here is an example of an API to send back an API response when something is posted into and API and called it to an another API. Folder Structure is Like // src/routes/index.js const express = require(‘express’); const router = express.Router(); const axios = require(‘axios’); router.post(‘/fetchStatement’, async (req, res, next) => { try { const… Continue reading Node Js App to call back an API

Deploy the Node.js in Render.com for free.

Create a Node.js project and deploy the codes into the GitHub by creating a new repository. Login to the website of Render Dashboard using the GitHub account and “Authorize Render.” Enter the email and complete signup. Select “New Web Services”. Click “Connect to GitHub”. Select the repository as our requirements. Fill the fields that needed… Continue reading Deploy the Node.js in Render.com for free.

How to create a REST API with Node.js and Express

to create the REST APIS in the node application Creating a folder structure Open image-20240422-093737.png ├── config/ └── db.js ├── models/ └── Student.js ├── routes/ └── studentRoutes.js ├── controllers/ └── studentController.js ├── app.js └── package.json app.js File const express = require(‘express’) const app = express(); const Student = require(‘./models/student’) const mongoose = require(‘mongoose’); const studentRoutes… Continue reading How to create a REST API with Node.js and Express

Node Js Mobile OTP based authentication and authorization API using Nodejs and Mongodb

Dependencies 1) Express Js Express is a back end framework for Node.js.It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js 2) Mongoose Mongoose is a Database ODM for Nodejs. It provide schema based api to model our mongodb schema.It is famous in world… Continue reading Node Js Mobile OTP based authentication and authorization API using Nodejs and Mongodb