Node.js code for making a POST API call to NetSuite using OAuth 1.0.

const axios = require(‘axios’); const CryptoJS = require(‘crypto-js’); const ACCOUNT_ID = ”; const ENDPOINT = “; const AUTH = {     consumerKey: ”,     consumerSecret: ”,     token: ”,     tokenSecret: ” }; function generateOAuthHeader(httpMethod, url) {     try {         const nonce = Math.random().toString(36).substring(2);    … Continue reading Node.js code for making a POST API call to NetSuite using OAuth 1.0.

User Registration System – Complete Technical Documentation (Next js and Node js)

1. Overview  This document details the full implementation of the User Registration feature across Frontend (Next.js 13+ App Router) and Backend (Node.js Microservice).  The system enables users to:  Register with validated personal details  Securely store credentials in PostgreSQL  Receive real-time feedback (success/error)  Redirect to login upon successful registration    2. System Architecture  Frontend (Next.js)   … Continue reading User Registration System – Complete Technical Documentation (Next js and Node js)

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.