Node.js fs.unlinkSync() Method
The fs.unlinkSync() method is used to synchronously remove a file or symbolic link from the filesystem. This function does not work on directories, therefore it is recommended to use fs.rmdir() to remove a directory.Syntax:...
read more
Node.js fs.statSync() Method
The fs.statSync() method is used to synchronously return information about the given file path. The fs.Stat object returned has several fields and methods to get more details about the file.Syntax:...
read more
Node.js fs.mkdirSync() Method
The fs.mkdirSync() method is an inbuilt application programming interface of fs module which provides an API for interacting with the file system in a manner closely modeled around standard POSIX functions. The fs.mkdirSync() method is used to create a directory Synchronously....
read more
Node.js crypto.createHmac() Method
The crypto.createHmac() method is used to create an Hmac object that uses the stated ‘algorithm’ and ‘key’. Syntax:...
read more
Node.js path.relative() Method
The path.relative() method is used to find the relative path from a given path to another path based on the current working directory. If both the given paths are the same, it would resolve to a zero-length string....
read more
Node.js process.stdin Property
The process.stdin property is an inbuilt application programming interface of the process module which listens for the user input. The stdin property of the process object is a Readable Stream. It uses on() function to listen for the event....
read more
Node.js fs.copyFileSync() Function
The fs.copyFileSync() method is used to synchronously copy a file from the source path to destination path. Node.js will overwrite the file if it already exists in the destination. The optional mode parameter can be used to specify the behavior of the copy operation....
read more
Node.js fsPromises.readFile() Method
The fsPromises.readFile() method is used to read the file. This method read the entire file into the buffer. To load the fs module, we use require() method. It Asynchronously reads the entire contents of a file....
read more
How to Run Many Parallel HTTP Requests using Node.js ?
We know NodeJS application is single-threaded. Say, if processing involves request A that takes 10 seconds, it does not mean that a request which comes after this request needs to wait 10 seconds to start processing because NodeJS event loops are only single-threaded. The entire NodeJS architecture is not single-threaded....
read more
Node.js | fs.appendFileSync() Function
The fs.appendFileSync() method is used to synchronously append the given data to a file. A new file is created if it does not exist. The optional options parameter can be used to modify the behavior of the operation....
read more
Node.js | os.tmpdir() Method
The os.tmpdir() method is an inbuilt application programming interface of the os module which is used to get path of default directory for temporary files of the operating system....
read more
Node.js Stream readable.pipe() Method
The readable.pipe() method in a Readable Stream is used to attach a Writable stream to the readable stream so that it consequently switches into flowing mode and then pushes all the data that it has to the attached Writable....
read more