node--CommonJS

1、CommonJS

1) there is no standard to make up for deficiencies js

 

2, Node module

1) is divided into core modules and user-defined modules

2) we can pull away public functions as a separate js file as a module

One of the members and the outside world can not access the property, to be managed during the visit, need

exports Keywords for export.

We were introduced through require the use of

If the module is present in node_, modules directory, you need to add the relative path, the recursive search is

To even the Table of Contents, paths are also omitted collectively, we need to generate files package.json NPM, through which the main attribute specified file is introduced

 

Guess you like

Origin www.cnblogs.com/Tanqurey/p/11141294.html