// In node project we would normally use to a third party dependencies, such as the following code
var Template = the require ( 'Template-Art')
How the program is loaded into the third-party file package it?
- Locate the directory node_module in the root directory of the current project
- Found art-template directory in the directory node_module
- Find package.json file in the ar-template directory
- Read the main file attributes package.json
- mian execution entry records the file attribute of the current packet
- The file entry is then loaded, it is loaded to the art-template dependent package
- If you do not package.json file, or no main attribute, it will default load index.js
- If it does not index.js, will be the parent directory to the root directory of the current project to find, knowing disk root directory
- If not, it will error