Difference between Synchronous methods and Asynchronous methods
Synchronous methods |
Asynchronous methods |
---|---|
Synchronous functions are called blocking functions |
Asynchronous functions are called non-blocking functions. |
These functions take File Descriptor as the last argument. |
These functions take a callback function as the last argument. |
It blocks the execution of the program until the file operation has finished processing. |
It does not block the execution of the program. |
Examples: fs.readFileSync(), fs.appendFileSync(), fs.writeFileSync() etc. |
Examples: fs.readFile(), fs.appendFile(), fs.writeFile(), fs.stat() etc. |
How to Install NPM FS in Node JS ?
The file system module allows you to work with the file system on your computer NodeJS includes the fs module, to communicate with file systems. It provides functionality for interacting with the file system, such as reading from and writing to files, creating and removing directories, etc. The File System module in NodeJS is one of the most important and helpful modules.
Table of Content
- What is NPM FS?
- Understanding NodeJS
- Common use for the File System module
- Some Advantages of Using NPM FS
- Asynchronous vs. Synchronous fs Methods
- Difference between Synchronous methods and Asynchronous methods
- Installing NPM FS on NodeJS
- Installing Dependencies for NPM FS
- Testing the Installation of NPM FS
- Errors During Installation