1.

What do you understand by Module in Node.js?

Answer»

A reusable block of code which may not impact the other codes through its presence is called a Module. Modules are presented in ES6. Modules are significant for MAINTAINABILITY, Reusability, and Namespacing of Code. 

Module in Node.js is a basic or complex functionality organized  in single or VARIOUS JavaScript documents which can be reused all through the Node.js applications.  

Every module in Node.js has its own unique circumstances, so it can't meddle with different modules or contaminate global modules. Additionally, every module can be put in a different .js record under a different envelope.  

Node.js actualizes CommonJS modules standard. CommonJS is a gathering of volunteers who characterize JavaScript guidelines for WEB server, work area, and REASSURE application. 

Node.js includes three types of modules: 

  1. Core Modules:- Node.js is a lightweight framework and core modules carry the minimal functionality of Node.js. 
  2. Local Modules:- Any Module which is locally created for one application and doesn’t have any scope outside the parent application is known as a Local Module.  
  3. Third Party Modules:- All external functionality which is available through export module can be imported and used in the application is called a Third Party Module. 


Discussion

No Comment Found