Node.js

단단한어린이·2022년 4월 5일
0

Web Server

목록 보기
1/1
post-thumbnail

Node.js is a JavaScript runtime environment built with the Chrome V8 Javascript engine. In short, the Javascript execution environment that allows Javascript, which used to operate in an environment other than a browser is Node.js.
Node.js is primarily used to develop server-side applications and provides built-in APIs such as modules, file systems, and HTTP. Node.js is suitalbe for SPA where frequent i/o occurs by processing data in real time. However, it is not recommended for applications with high cpu usage.
In addition to developing server application in the back-end area, Node.js also runs various tools and libraries in the front-end area in the Node.js environment.

  • Node.js is developed using JavaScript. The isomorphism of using JavaScript in front-end and back-end has the advantage of shortening separate language learning times.

JavaScript is handled by a JavaScript engine, not a rendering engine. When the HTML parser encounters a script tag, it stops the DOM generation process to execute JavaScript code and hands control over to the JavaScript engine. The JavaScript engine, which takes over, loads and parses JavaScript code in the script tag or the JavaScript file defined in the src attribute of the script tag. When JavaScript is completely executed, the control authority is handed over to the HTML parser again to resume DOM generation from the time the browser stops.
As such, the browser processes HTML, CSS, and Javascript synchronously. This means that the generation of the DOM may be delayed due to the occurrence of blocking according to the location of the script tag. Therefore, the location of the script tag has an important meaning.
Positioning JavaScript at the bottom of the body element is a good idea. Here's the reasons

  • An error occurs when JavaScript manipulates the DOM while the DOM is not completed.
  • The page loading time is shortened because HTML elements do not interfere with rendering due to script loading delays.
profile
Footprints in Coding

0개의 댓글