Inside the Nodejs, the files and modules are one by one corresponding
There are several different types of modules, which can be divided into core modules, local modules, and third-party modules installed through NPM, depending on the type of module there are several ways to introduce modules, below we will
Understand this knowledge
In Nodejs, the module can be introduced via file path.
var util = require ('./util.js ');
You can also refer to the module name by
var promise = require (' Bluebird ');
If you refer to a non-core module by name, node will eventually map the module name to the path of the corresponding module name, and those core modules that contain the core function will be preloaded in node startup.
Non-core modules include installing third-party modules using NPM and local modules created by you or your colleagues
Classification of node. JS Modules