reading-notes

Node.js

V8 engine - the open-source JavaScript engine that runs in Google Chrome and other Chromium-based web browsers, including Brave, Opera, and Vivaldi. It was designed with performance in mind and is responsible for compiling JavaScript directly to native machine code that your computer can execute.

node.js - is a JavaScript runtime

the download page for node.js is https://nodejs.org/en/download

You can check that Node is installed on your system by opening a terminal and typing

node -v.

Node comes bundled with a package manager called npm

the linter for node is called jshint

Node.js runs JavaScript on the server

It is single threaded and event-driven which means that every thing that happens in Node is in reaction to an event

Node uses libraries and is capable of handing a large number of simultaneous connections

The traditional approach to scaling a Node app is to clone it and have the cloned instances share the workload

The Node Execution Model

  1. Node apps pass async tasks to the event loop, along with a callback
  2. The event loop efficiently manages a thread pool and executes tasks efficiently
  3. Then executes each call back as tasks complete

blocking I/0 calls should be avoided

Node is particularly suited to building applications that require some form of real-time interaction or collaboration — for example, chat sites, or apps such as CodeShare, where you can watch a document being edited live by someone else. It’s also a good fit for building APIs where you’re handling lots of requests that are I/O driven (such as those needing to perform operations on a database), or for sites involving data streaming, as Node makes it possible to process files while they’re still being uploaded

Node makes it easier to share code between the server and the client. It speaks JSON and it is considered easier than other server-side languages

https://deannaj401.github.io/reading-notes/