how to check empty object in node js?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check the empty object in node js, just use the Object.keys() method it will create an array of object keys after then you can check the length and if it鈥檚 equal to 0 means the object is empty. Like the following example, let鈥檚 take the below array of objects example here we will find an index of id 3 and delete it from the array....

July 9, 2022 路 2 min 路 Infinitbility

how to add string to array in node js?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To add string to array in node js, just use the push() method it will add your data into an array as the last element. Like the following example, we can add string to array using the push() method. let arr = ["infinitbility","aguidehub"]; arr.push("sortoutcode"); console.log(arr); // ['infinitbility', 'aguidehub', 'sortoutcode'] Today, I鈥檓 going to show you How do i add string to array in node js, as above mentioned here, I鈥檓 going to use the push() method for adding new elements into the array....

July 8, 2022 路 2 min 路 Infinitbility

how to check empty string in node js?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check an empty string in node js, use the if..else statement just pass and put your string variable in an if condition if it鈥檚 empty it will go to the else statement. In the following example, we will take the sample empty string and use the if..else statement. let str = ""; if(str){ console.log("str is not empty"); } else { console.log("str is empty"); } // str is empty Today, I鈥檓 going to show you How do i check an empty string in node js, as mentioned above, I鈥檓 going to use the use if....

July 7, 2022 路 2 min 路 Infinitbility

how to get length of string in node js?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get length of string in node js, use the String length property it will return your string char count. The length property of a String object contains the length of the string, in UTF-16 code units. length is a read-only data property of string instances. In the following example, we will take the sample string and use string length to get a count of the string....

July 7, 2022 路 2 min 路 Infinitbility

node js convert string to number

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To convert a string to a number in node js, you can use the + plus operator it鈥檚 the fastest way to convert a string to a number. In the following example, we will take the sample string variable, and convert it into an integer using the plus operator. let text = "24325"; // using plus operator let num = +text; console.log(num) // 24325 Today, I鈥檓 going to show you How do i convert string to number in node js, as above mentioned here, I鈥檓 going to use the plus operator and string interpolation....

July 7, 2022 路 2 min 路 Infinitbility

how to replace string in node js?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To replace string in node js, use the replace() and use replace() with /PUT_HERE_REPLACEABLE_STRING/g regex method. the replace() method replace your first occurrence ( match ) from your string the replace() method with regex will replace all occurrences from your string Just you have to pass two parameters, in the first parameter you have to pass what you want to replace and in the second parameter you have to pass what you want to put in the place of replace string....

July 6, 2022 路 2 min 路 Infinitbility

How to export multiple files in a single file in node js?

Hi Friends 馃憢, Welcome To Infinitbility 鉂わ笍! Today, we will learn to export multiple files in a single file, for example, we have a lot of controller files in the node project but when I want to use any controller function then I don鈥檛 have to write also controller name. Here, one more reason to do that way because in future when move one function to another controller then we haven鈥檛 worry about change imports also鈥...

March 25, 2022 路 2 min 路 Infinitbility

Sequelize where in and where not in array example

Hello Friends, Welcome To Infinitbility! This article based on sequelize where in and where not in query, here you will learn to write where in query in sequelize and also how many way to do. For managing where in and not in types of query sequelize provide operators. Let start today article Sequelize where in and where not in array example In this article, you will get examples of query using where in or where not in array....

July 5, 2021 路 1 min 路 Infinitbility

Sequelize Operators Example with query

Hello Friends, Welcome To Infinitbility! Today, we will learn about sequelize operators How to use sequelize operators Where to use sequelize operators what operation we can be done with sequelize operators We use greater than, less than, Greater than or equal, Less than or equal, Not equal, Equal , sign in sql but in sequelize we use as Operators to done this types of query. One more thing sequelize Operators also use for and and or types of query....

July 2, 2021 路 3 min 路 Infinitbility

Node sequelize update query example

Hello Friends, Welcome To Infinitbility! To update data in the database, sequelize provide update() method it will update your data on the database based on your condition. using sequelize update method we are able to write SQL update query in a function and JSON parameters. This article based on sequelize update query, here you will get update query examples to do on your project. If you are looking for sequelize basics query example for crud check below article it鈥檚 based on sequelize create, select, delete, and update, and join examples...

July 1, 2021 路 1 min 路 Infinitbility

Node sequelize where or query example

Hello Friends, Welcome To Infinitbility! This article based on where or query in node sequelize, here you will get example of where or query. Sequelize provide operator functionality to manage this types of query. For using operator you have to import op from sequelize like below. const { Op } = require("sequelize"); For using or condition we have to Op.or in where condition like below example. const { Op } = require("sequelize"); Post....

June 30, 2021 路 1 min 路 Infinitbility

Node.js sequelize query examples

Hello Friends, Welcome To Infinitbility! This article help you to write query in node with sequelize. here you get examples query of insert, update, select, delete, and join query with code snippest. Let鈥檚 start today topic Node.js sequelize query examples Or how to write query in node sequelize Table of content Insert query Update query Select query Delete query Join or Eager query Insert query Node sequelize provide create() method to create new record or row in table also return row id and row details....

May 5, 2021 路 3 min 路 Infinitbility

integrate Mustache nodejs example

Hello Friends, Welcome To Infinitbility! This article explain and provide example to implement Mustache template in node js. we are assuming you want send mustache template content in your mail function. Let鈥檚 start today topic integrate mustache template in nodejs with typescript Start with Installation npm install consolidate mustache --save install consolidate and mustache library to setup mustache render engine Setup mustache engine app.ts import consolidate engine import engine from "consolidate"; create private function initializeMailTemplate private initializeMailTemplate(){ // set templates folder this....

May 1, 2021 路 2 min 路 Infinitbility

How to deploy nodejs application subdirectory level in apache ubuntu

Hello Friends, Welcome To Infinitbility! In this Article, we deploy nodejs application subdirectory level in apache ubuntu server. here you get complete tutorial to deploy, setup, and run node js project in apache server. let鈥檚 start with subdirectory. what is Subdirectory url level? Some people also say sub url or custom url. subdirectory come after core domain. Take below example. here https://infinitbility.com is core domain & category is a subdirectory url....

February 1, 2021 路 3 min 路 Infinitbility