Node.js
Node.js is an event-based, non-blocking, asynchronous I/O runtime that uses Google’s V8 JavaScript engine and libuv library.
Node.js is a program we can use to execute JavaScript on our computers. In other words, it’s a JavaScript runtime.
Notes :
- Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine.
- The V8 engine is the open-source JavaScript engine that runs in Google Chrome and other Chromium-based web browsers, including Brave, Opera, and Vivaldi. it’s responsible for compiling JS code.
- It’s better to install NVM(Node Version Manager), in case you have to install different versions of node JS.
- To install nvm please follow it’s original repo NVM
- To check the node versions you have, type nvm ls
- To install a certain version of nvm, type nvm install -version-
- To use a node version other than the one you are using, type nvm use -version-.
- Please refer to this page for deploying nvm nvm guide
- We use npm to install node packages.
- When installing node packages it will create a file package.json, and it will contain all the packages we installed.
Installing jshint package Globally
npm install -g jshint
then adding
/* jshint esversion: 6 */
at the top of JS file.
Working with the package.json File
npm install
Node.js speaks JSON. JSON is probably the most important data exchange format on the Web, and the lingua franca for interacting with object databases.
What Is Node.js Used For?
installing (via npm) and running (via Node)