Mayank Agarwal has Published 410 Articles

Difference between NodeJS and ReactJS

Mayank Agarwal

Mayank Agarwal

Updated on 29-Apr-2021 09:19:07

338 Views

ReactJS and NodeJS both are a widely used subsets of JavaScript nowadays with high performance. But both are different in someways. In the below article, we will discuss the difference between the two and which is better to use to build a web application and why ?NodeJSIt is a completely ... Read More

writeJson() function in fs-extra - NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:36:01

1K+ Views

writeJson() writes an object to a JSON file by parsing.SyntaxwriteJson(file, object[, options] [, callback])Parametersfile – String parameter which will contain name and location of the JSON file.object – Object passed into the writeJson function.options – The 'outputFile' function supports the following options −spaces – The number of spaces will be passed in this parameter ... Read More

URLSearchParams values & keys() in Node

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:31:36

343 Views

Introduction to values()This function returns an iterator that allows us to iterate all over the values that are present in that object. It basically gives us a tool to select or iterate the values and then perform functions on them.SyntaxURLSearchParams.values();It will return an ES6 type iterator with the name-value pair ... Read More

URLSearchParams sort & toString() in Node

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:25:04

123 Views

Introduction to sort()This function sorts the existing name-value pairs by their names. The sorting is done inplace. It used stable algorithm for sorting.SyntaxURLSearchParams.sort(name);It will return a sorted order of elements (name-value pairs) by sorting them based on their key value.Example// Defining the parameters as a constant const params = new ... Read More

URLSearchParams.set & append() in Node

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:16:38

577 Views

Introduction to set()This function can be used to set the value of the name argument passed with the new value passed. If multiple name-value pair exists, only one name-value pair will be set and all the remaining pairs will be removed as shown in the example below.SyntaxURLSearchParams.set(name, value);ParametersThe inputs are ... Read More

URLSearchParams.has & delete() in Node

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:13:08

175 Views

Introduction to has()This function returns true or false based upon the query argument. The function will return true if name-value pair exists for the argument.Syntaxvar bool = URLSearchParams.has(name);It will return TRUE if name is present, else FALSE.ParametersThe input parameter is a name that needs to be searched in the URL.Example // ... Read More

URLSearchParams.get & getAll() in Node

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:08:04

211 Views

Introduction to get()This function returns the first name-value pair that is matched with the name passed in the parameter. Returns null if no such value exists. If more than one name-value pair exists it will return the first occurence of that element in the URL.SyntaxURLSearchParams.get(name);It will return a single string ... Read More

URLSearchParams entries & forEach in Node

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:05:54

350 Views

Introduction to entries() −This function returns an iterator that allows us to iterate all over the entry set that are present in the object. It basically gives us a tool to iterate over the complete entry set of the param object.SyntaxURLSearchParams.entries();It will return an ES6 type iterator with all the ... Read More

Updating a record in MySQL using NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:03:17

1K+ Views

In this article, we will see how we can update a record in MySQL using NodeJS. We will dynamically update MySQL table values from Node.js server. You can use the select statement after updating to check if the MySql record is updated.Before proceeding, please check the following steps are already ... Read More

Sync vs Async vs Async/Await in fs-extra - NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2021 07:00:22

279 Views

Introduction to fs-extraBefore proceeding with fs-extra, one must have a basic knowledge of the fs file system. The fs-extra is an extension of the fs file system and has more methods than it. It adds some file method systems that are not there in the naive fs modules. Fs-extra adds ... Read More

Advertisements