P
P
pipeul2021-03-06 14:15:32
Node.js
pipeul, 2021-03-06 14:15:32

Explain what is Node.js and how does it work?

Yes, I googled, but I did not fully understand (probably). In general, node is a program that converts js into code understandable for machines (on which the database is). It accepts user requests and sends back some applications or packages, acting as a server. From the ability to control the OS, it can also be used to program various devices, gadgets (fitness bracelets, phones, etc.). Communication with the site is carried out through NPM and NPX. I understand correctly, is there anything else I need to know? Before starting the study, I would like to know how this platform is arranged and works.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
index0h, 2021-03-06
@index0h

You have all the cheese in one dumpling. Start simple, read what an interpreter is. Node is an interpreter for the js language.
Server, requests, clients, etc. - this is about network interaction, read about HTTP and how it works.

From the ability to manage the OS

There are no "abilities", there are OS system calls, read what it is.
can also be used for programming various devices, gadgets (fitness bracelets, phones, etc.).

It is possible, only on gadgets there are quite a few resources.
Communication with the site is carried out through NPM and NPX.

Again, read about HTTP.
NPM is a package manager, its main task is to download from outside the code that will be used by you.

V
Vitaly, 2021-03-06
@vshvydky

Node.js is a platform that combines several technologies.
Execution using the Chromium V8 engine.
Event loop handling is implemented using LibUV.
The node.js standard libraries are implemented in C and provide interaction with the operating system, file system, network, I/O, and so on.
The NPM package manager (essentially a repository of external modules for js) also comes with the Node.js package and provides the ability to use modules published by other authors there.
Node.js is a single-threaded asynchronous execution environment, before starting programming in js, it is advisable to carefully read the documentation on js itself, then the documentation on nodejs https://nodejs.org/
Node.js at first glance looks like a quick entry into writing server-side code or server-side executable scripts, however, this accessibility is a rather strong minus, because it allows those who have not bothered to study it in depth to create architectural invalids, which sooner or later leads to that such projects look bad.
Separately, about programming for devices, node.js does not compile its code, and therefore on any device you will have a set of your files plus all the packages from node_modules that you install. Naturally, you should already have node.js on any device, or you should be able to install it there.
Of the obvious advantages, writing back and front in the same language, a fairly mature community and many packages available in npm to solve many problems.
Of the obvious disadvantages, due to insufficient knowledge of js and understanding of the operation of the event loop, people very often write terrible code that turns out to be very complex.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question