node. JS is a platform that allows JavaScript to run on the server side. node. JS is a platform created for real-time Web application development that takes into account the scalability of the architecture in real-time response/hyper-scale data requirements. It uses a single-threaded, asynchronous stone IO, event-driven design pattern.
node. JS has a powerful and flexible Package Manager (Node Pack manager) NPM
node. JS Architecture Design: 1, asynchronous I/O, event-driven
2,V8 engine as JavaScript engine
3, efficient Libev event-driven library
4, efficient Libeio asynchronous I/O Library
Commonjs:javascript Specification API
node. js's event loop mechanism:
node. JS's program starts with the event loop, ends with the event loop, all the logic is the callback function of the event, so node. js is always in the event loop, and the program entry is the callback function for the first event in the event loop. For the event loop graph
node. JS provides the Require function to invoke other modules, and the modules are based on the file system, and the mechanism is simple.
What is a module: The module is a basic part of node. JS's application, and the files and modules are one by one corresponding. In other words, a node. js file is a module that may be a JavaScript code, JSON, or a compiled C + + extension.
node. JS provides the exports and require two objects, where exports is the interface that the module exposes, and require is the interface to get a module externally, which is the exports object of the acquired module.
Single load: Require does not load the module repeatedly, that is, the modules obtained are the same regardless of how many times require are called.
Express Architecture: