Basic knowledge of nodejs

  • 2021-07-16 01:22:17
  • OfStack

What is nodejs?

node. js is a platform based on Chrome and javaScript runtime, which is used to build network applications with fast response speed and easy expansion. (But nodejs is not an javascript application, and nodejs is written in c + +.)

js is a scripting language that requires a parser to run. For JS written in the HTML page, the browser acts as the parser. For JS that needs to run independently, nodejs is a parser.

Each parser is a runtime environment, which can do the following things:

1. Allow JS to define various data structures and perform operations;

2. Allow JS to use built-in objects and methods provided by the runtime environment.

Example: JS running in a browser is used to manipulate DOM, and the browser provides built-in objects such as document.

JS running in nodejs is used to operate disk files or build HTT server, and nodejs provides fs, http and other built-in objects accordingly.

nodejs Features:

1. It is an JavaScript runtime

2. Code interpretation relies on the Chrome V 8 engine

3. Event-driven

4. Asynchronous I/O (non-blocking I/O)

5. Events and callbacks (lightweight, scalable, suitable for real-time data interaction applications)

6. Single process and single thread

7. Cross-platform

https://www.ofstack.com/article/104455. htm (explain the characteristics of nodejs in detail)


Related articles: