Node.js Module:

Module in NodeJS is a simple or complex functionality organized in single or multiple JavaScript files which can be reused throughout the NodeJS application.

Each module in NodeJS has its own context, so it cannot interfere with other modules or pollute global scope. Also, each module can be placed in a separate .js file under a separate folder.

Module Types:

NodeJS includes three types of modules:

  1. Core Modules: Modules was shipped with NodeJS runtime to handle complex operations and can be reused for every Node programs.
  2. Local Modules: modules developed by developers for their specific logic depend on projects
  3. Third Party Modules: modules was developed by third-parties to provide their library functionality to developer all over the world and commonly get through npm

results matching ""

    No results matching ""