Node JS Modules
Module in Node.js is some functionality organized in the JavaScript files (single or multiple) which can be reused throughout the Node.js application.
Each module in Node JS has its own scope, which means there are no chances of conflicts with other modules.
Benefits of diving the application in Modules:
Types of Modules in Node JS:
1. Your own modules (Local Modules)
2. Modules which Node Js provides you (Core Modules )
Example: FileSystem, Http etc.
3. Third-party Modules (which we download and install using NPM)
Module in Node.js is some functionality organized in the JavaScript files (single or multiple) which can be reused throughout the Node.js application.
Each module in Node JS has its own scope, which means there are no chances of conflicts with other modules.
Benefits of diving the application in Modules:
- Reusability of Code (functionality) at multiple places in the application wherever required.
- Testing the application becomes a lot easier because to test a certain functionality you only have to test the particular module, not the complete application.
Types of Modules in Node JS:
1. Your own modules (Local Modules)
2. Modules which Node Js provides you (Core Modules )
Example: FileSystem, Http etc.
3. Third-party Modules (which we download and install using NPM)
0 Comments