The article directories

  • 1.1 What is Node.js
  • JavaScript in the browser
  • 1.2 JavaScript in Node.js
  • 1.3 What can Node.js do
  • 1.4. Prepare knowledge
  • 1.5. Some resources
  • 1.6. What can you learn from this course?

1.1 What is Node.js

  • Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine.

    • Node.js is not a language
    • Node.js is not a library, not a framework
    • Node.js is a JavaScript runtime environment
    • Simply put, Node. js parses and executes JavaScript code
    • Previously only browsers could parse and execute JavaScript code
    • That means JavaScript can now run completely out of the browser thanks to Node.js

JavaScript in the browser

  • EcmaScript

    • Basic grammar
    • if
    • var
    • function
    • Object
    • Array
  • BOM

  • DOM

1.2 JavaScript in Node.js

  • No BOM, NO DOM

  • The basic JavaScript language part of EcmaScript

  • There are several server-level apis for JavaScript in Node

    • Ability to manipulate files (such as file reading and writing)
    • Construction of network services
    • Network communication
    • HTTP service capabilities
    • For example, build network communication for file read and write network services
    • HTTP server and so on
  • Built with Chrome’s V8 engine on top

    • The code is just a string with a particular format
    • The engine can understand it, the engine can help you parse and implement it
    • Google Chrome’s V8 engine is currently recognized as the fastest parsing executing JavaScript code
    • The authors of Node.js have ported the V8 engine from Google Chrome and developed a separate JavaScript runtime environment. |
  • Node.js uses an event-driven, non-blocking IO model, making it lightweight and efficient.

  • Node.js package ecosystem NPM is the largest open source library ecosystem in the world.

  • Most JavaScript related packages are stored on NPM to make it easier for developers to download and use.

  • NPM install jquery

1.3 What can Node.js do

  • Web Server Background

  • Command line tool

    • npm(node)
    • Git (c)
    • hexo(node)
  • For front-end developers, Node is mostly used for its command-line tools.

    • Their own writing is very little, mainly using someone else’s third party
    • webpack
    • gulp
    • npm

1.4. Prepare knowledge

  • HTML

  • css

  • JavaScript

  • Simple command line operations

    • cd
    • dir
    • ls
    • mkdir
    • rm
  • Experience in server development is a plus

1.5. Some resources

  • Nodeljs in A Nutshell

    • PiaoLing
    • Partial theory, almost no actual combat line content – understanding the underlying principle is helpful
    • Look at it in conjunction with the course
  • The Definitive Guide to Node.js

    • API on
    • No business, no actual combat
  • JavaScript reference standard (alpha) : this tutorial javascript.ruanyifeng.com/

  • Introduction to the Node: www.nodebeginner.org/index-zh-cn…

  • Official API documentation: nodejs.org/dist/latest…

  • Chinese document (version is old, do look) : www.nodeclass.com/api/node.ht…

  • CNODE community: http:/lcnodejs.org

  • CNODE- For starters: cnodejs.org/getstart

1.6. What can you learn from this course?

  • B/S programming model

    • Browser – Servero
    • back-end
    • This BS programming model is the same for any server-side technology, language independent
    • Node is just a tool for learning the BS programming model
  • Modular programming

    • RequireJS
    • SeaJS
    • @import(' file path ')
    • Previously known JavaScript could only be loaded with script tags
    • In Node you can look like@import()The same as loading JavaScript script files by reference
  • The Node commonly used API

  • Asynchronous programming

    • The callback function
    • Promise
    • async
    • generator
  • Express Web development framework

  • Ecmascript 6

  • Learning Node will not only help you open the server black box, it will also help you learn the advanced content of the front-end

    • Vue.js
    • React
    • angular