Nodejs
Getting started with the server-side JavaScript runtime environment Node.js. Node.js is built on top of the Google Chrome V8 JavaScript engine and is primarily used to create web servers - but not limited to that.
Node.js introduction
Node.js is an open source and cross-platform JavaScript runtime environment that allows javascript to run outside of the browser. It is a popular tool that can be used for almost any project, allowing us to write server-side and web-related applications through JavaScript and a series of modules.
Node.js is an open source and cross-platform JavaScript runtime environment. It is a popular tool for almost any type of project!
Node.js runs the V8 JavaScript engine (the core of Google Chrome) outside of the browser. This makes Node.js very efficient.
Node.js applications run in a single process without the need to create a new thread for each request. Node.js provides a set of asynchronous I/O primitives in its standard library to prevent JavaScript code from blocking, and in general, libraries in Node.js are written using a non-blocking paradigm, which makes blocking behavior an exception rather than the norm.
When Node.js performs an I/O operation, such as reading from the network, accessing a database, or a file system, instead of blocking threads and wasting CPU cycles waiting, Node.js resumes the operation when the response returns.
This allows Node.js to handle thousands of concurrent connections using a single server without introducing the burden of managing thread concurrency (which can be a significant source of errors).
Node.js has a unique advantage because millions of front-end developers who write JavaScript for browsers are now able to write server-side code in addition to client-side code without having to learn an entirely different language.
In Node.js, the new ECMAScript standard can be used without a problem, as you don't have to wait for all users to update their browsers - you are responsible for deciding which ECMAScript version to use by changing the Node.js version, You can also enable certain experimental features by running Node.js with flags.
Node.js was released in May 2009, developed by Ryan Dahl, is a Chrome V8 engine based JavaScript runtime environment, using an event-driven, non-blocking I/O model, allowing JavaScript to run on the server-side development platform. It makes JavaScript a scripting language on par with server-side languages like PHP, Python, Perl, and Ruby.
How do I install Node.js
How to install Node.js on your system: Package Manager, official website installer, or nvm.
Node.js can be installed in different ways. This article highlights the most common and the most convenient. https://nodejs.cn/download/ provides all of the main platform of the official package.
A very convenient way to install Node.js is through the package manager. In this case, each operating system has its own. https://dev.nodejs.cn/download/package-manager/ lists the MacOS, Linux and Windows of the other package manager.
nvm is a popular way to run Node.js. It allows you to easily switch between Node.js versions and install new versions to try to easily roll back if something goes wrong. It is also useful to test code with older versions of Node.js.
For more information about this option, see https://github.com/nvm-sh/nvm.
In any case, after installing Node.js, you can access the node executable from the command line.
npm Introduction
npm is the standard package manager for Node.js.
In September 2022, it was reported that more than 2.1 million packages were listed in the npm registry, making it the largest single language code repository on the planet, and you can be sure there are packages for (almost) everything.
It started out as a way to download and manage Node.js package dependencies, but has since become a tool that is also used in front-end JavaScript.
Yarn and pnpm are alternatives to npm cli. You can also view them.