Node.js util.format() Method
The util.format() (Added in v0.5.3) method is an inbuilt application programming interface of the util module which is like printf format string and returns a formatted string using the first argument. The formatted string contains zero or more format specifiers in which the corresponding argument value is converted and replaced. It is used as a debugging tool in a synchronous method hence, it can have a significant performance overhead that could block the event loop. It is recommended not to use this function in a hot code path....
read more
Node.js querystring.parse() Method
The querystring.parse() method is used to parse a URL query string into an object that contains the key and pair values of the query URL. The object returned does not inherit prototypes from the JavaScript object, therefore usual Object methods will not work. During parsing, the UTF-8 encoding format is assumed unless there is an alternative character encoding format. To decode alternative character encoding, the decodeURIComponent option has to be specified....
read more
Node.js dns.lookup() Method
The dns.lookup() method is an inbuilt application programming interface of the dns module which is used to resolve IP addresses of the specified hostname for given parameters into the first found A (IPv4) or AAAA (IPv6) record....
read more
Node.js Buffer.from() Method
The Buffer.from() method is used to create a new buffer containing the specified string, array, or buffer....
read more
Node.js fsPromises.writeFile() Method
The fsPromises.writeFile() method is used to asynchronously write the specified data to a file. By default, the file would be replaced if it exists. The ‘options’ parameter can be used to modify the functionality of the method....
read more
Node.js crypto.pbkdf2() Method
The crypto.pbkdf2() method gives an asynchronous Password-Based Key Derivation Function 2 i.e. (PBKDF2) implementation. Moreover, a particular HMAC digest algorithm which is defined by digest is implemented to derive a key of the required byte length (keylen) from the stated password, salt, and iterations....
read more
What is Chunk in Node.js ?
In Node.js, the term “chunk” refers to a small, manageable piece of data that is part of a larger dataset. Node.js processes data in chunks, especially when dealing with streams, which makes handling large files or data sources more efficient and memory-friendly. This article explores what chunks are, how they work, and their significance in Node.js....
read more
How to copy folder recursively in Node.js ?
Node.js is an enhancement to the already existing JavaScript. It is used for server-side scripting. It is mostly used to develop dynamic web applications. Node.js developers prefer the use of asynchronous functions over synchronous functions as the former does not block program execution under any circumstances. Copying files or folders with multiple subfolders can be tedious using conventional Node.js file copying methods. However, the use of additional modules makes the task easier....
read more
Node.js fs.symlink() Function
The fs.symlink() method is used to create a symlink to the specified path. This creates a link making the path point to the target. The relative targets are relative to the link’s parent directory....
read more
Node.js fs.openSync() Method
The fs.openSync() method is an inbuilt application programming interface of fs module which is used to return an integer value that represents the file descriptor....
read more
Node.js process.cpuUsage() Method
The process.cpuUsage() method is an inbuilt application programming interface of the Process module which is used to get the user, system CPU time usage of the current process. It is returned as an object with property user and system, values are in microseconds. Return values may differ from the actual time elapsed especially for multi-core CPUs....
read more
Node.js process.chdir() Method
The process.chdir() method is an inbuilt application programming interface of the process module which is used to change the current working directory. Syntax:...
read more