Let’s start the module with a brief introduction to Node.js and recall what you have studied so far about JavaScript.
In the last video, you learnt that Node.js is an extension to JavaScript language and that JavaScript can be run on the client-side as well as the server-side. You also recalled what you have learnt about JavaScript so far and how you have used it as a client-side language. In the next video, you will learn how Node.js is defined in its official documentation.
In the last video, you learnt what Node.js is as per the definition in its official documentation.
Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine.
You also understood that modern browsers utilise the Just-In-Time (JIT) compilation technique, which compiles the entire code and converts it to the low-level machine code. Thus, an interpreter is not needed as an intermediary. This makes the execution time shorter and gives better performance.
In the last video, you learned that the major difference between the client-side JavaScript and Node is that the former is detected by a browser and is handed over to the browser's JavaScript engine, whereas the latter does not use any browser and is directly executed by the engine. Thus, Node uses the browser’s (Google Chrome's) engine V8 without using the browser.
In the next video, you will look at more differences between client-side JavaScript and Node.js.
In the last video, you learned that Node is built on top of the V8 engine and utilizes the majority of the features it supports on the client-side. Node offers additional features such as local file system management. Also, features such as DOM manipulation are dependent on the browser, and because the Node does not use any browser, such features are not supported in Node.
Before starting off to learn Node.js, you need to set up your environment to create and run a Node project. The next three segments will give you an idea of how to set up your codebase.
If you are a Windows user, then go to Segment 3 and skip Segment 4 as well as Segment 5.
In case you are a Mac user, then skip Segment 3 and directly jump to Segment 4. Also, skip Segment 5.
In case you are a Linux user, then skip Segment 3 and Segment 4 and directly jump to Segment 5 in this session.