1. What is nodejs
-
Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine.
-
Not a language, library, framework
-
Is a js runtime environment
-
nodejs can parse and execute js code, compared to the previous only browser can parse and execute js code, now Js can run completely without the browser.
-
The difference between js in the browser and js in nodejs
- The js in the browser is composed of three parts: ecmascript, DOM, and BOM
2. js in nodejs has no BOM, DOM, only ecmascript
- And in the js execution environment of node, some APIs for server-level operations are provided for js
1. File reading and writing (Js in the browser does not support)
2. Network service construction
3. Network communication
4. HTTP server...
-
Runtime environment built on Chrome's V8 engine
- Engine: Analyze and execute Js code
- Chrome's V8 engine is currently recognized as the fastest parsing and executing js code
- The author of Nodejs ported the V8 engine in Chrome and developed an independent js runtime environment (Nodejs).
-
Node.js uses an event-driven,non-blocking I/O model that makes it lightweight and effcient
- event-driven event-driven
- non-blocking I/O model Non-blocking I/O model (asynchronous)
- lightweight and efficient
-
Node.js’ package ecosystem,npm is the largest ecosystem of open source libraries in the world
- npm is the world's largest open source library ecosystem and is based on Nodejs
- Most js-related packages are stored on npm, in order to make it more convenient for developers to download and use packages
-
2. What can nodejs do
- web server backend
- Command line tool
- npm(node)
- hexo (node)
- git©
- …
- The front-end contacts with node the most are the command line tools: webpack, npm, etc.
3. Resources
- "Deep Move Out of Node.js"
- Author: Ling Park
- Partial theory, understanding the underlying principle is helpful
- "Node.js authoritative guide" API explanation
- javascript standard reference tutorial (alpha): https://javascript.ruanyifeng.com/
- Getting started with Node: https://www.nodebeginner.org/index-zh-cn.html
- Official API documentation: https://nodejs.org/dist/latest-v6.x/docs/api/
- Chinese document (older version): http://www.nodeclass.com/api/node.html
- CNODE community: https://cnodejs.org/
- CNODE-Getting Started for Newbies: https://cnodejs.org/getstart