Home >Web Front-end >Front-end Q&A >Is node.js a server language?

Is node.js a server language?

WBOY
WBOYOriginal
2022-07-04 16:37:532004browse

"node.js" is not a server language, but a JavaScript running environment based on the "Chrome V8" engine; nodejs uses an event-driven, non-blocking I/O model, which can be used on the server side. An open source, cross-platform execution environment for running JavaScript.

Is node.js a server language?

The operating environment of this article: Windows 10 system, nodejs version 12.19.0, Dell G3 computer.

node.js is not a server language

but a JavaScript running environment based on the Chrome V8 engine; nodejs uses an event-driven, non-blocking I/O model to allow JavaScript to run on the service End-to-end development platform.

Node.js is owned and maintained by the OpenJS Foundation (formerly the Node.js Foundation, which merged with the JS Foundation) and is a project of the Linux Foundation. Node.js uses the V8 execution code developed by Google and uses technologies such as event-driven, non-blocking and asynchronous input and output models to improve performance and optimize application transfer volume and scale. These techniques are typically used in data-intensive real-time applications.

Node.js Most of the basic modules are written in JavaScript language.

Before the emergence of Node.js, JavaScript was usually used as a client-side programming language, and programs written in JavaScript were often executed on the user's browser. The emergence of Node.js enables JavaScript to be used for server-side programming. Node.js contains a series of built-in modules that allow the program to run as a standalone server without Apache HTTP Server or IIS.

Simply put, Node.js is JavaScript running on the server side.

Node.js is a platform built on the Chrome JavaScript runtime.

Node.js is an event-driven I/O server-side JavaScript environment based on Google's V8 engine. The V8 engine executes Javascript very quickly and has very good performance.

Node.js uses the Google V8 JavaScript engine because:

V8 is open source software based on the BSD license

V8 is very fast

V8 is focused Regarding network functions, it is more mature in aspects such as HTTP, DNS, TCP, etc.

Node.js already has tens of thousands of modules, which can be downloaded for free through a manager called npm. The Node.js development community mainly has two mailing lists and an IRC channel called #node.js on freenode.

Extended knowledge

Main functions

The V8 engine itself uses some of the latest compilation technologies. This greatly improves the running speed of code written in scripting languages ​​​​such as Javascript and saves development costs. Demanding performance is a key factor in Node. Javascript is an event-driven language, and Node takes advantage of this to write a highly scalable server. Node uses an architecture called an "event loop" to make writing highly scalable servers easy and safe. There are a variety of techniques for improving server performance. Node has chosen an architecture that can both improve performance and reduce development complexity. This is a very important feature. Concurrent programming is often complex and full of landmines. Node bypasses these but still provides great performance.

Node uses a series of "non-blocking" libraries to support the event loop. Essentially, it provides interfaces for resources such as file systems and databases. When sending a request to the file system, there is no need to wait for the hard disk (to address and retrieve the file). The non-blocking interface will notify Node when the hard disk is ready. This model simplifies access to slow resources in a scalable way that is intuitive and easy to understand. Especially for users who are familiar with DOM events such as onmouseover and onclick, they will feel familiar.

Although letting Javascript run on the server side is not a unique feature of Node, it is one of its powerful features. We have to admit that the browser environment limits our freedom to choose programming languages. Any desire to share code between servers and increasingly complex browser client applications can only be achieved through Javascript. Although there are other platforms that support Javascript running on the server side, Node has developed rapidly and become the de facto platform because of the above characteristics.

In the short time since Node was launched, the community has contributed a large number of extension libraries (modules). Many of them are drivers for connecting to databases or other software, but many of them are very useful software produced by their capabilities.

Finally, I have to mention the Node community. Although the Node project is still very young, it is rare to see such a passionate community for a project. Whether you are a novice or an expert, everyone uses and contributes their abilities around the project, and is committed to creating a paradise for exploration, support, sharing, and listening to suggestions.

Recommended learning: "nodejs video tutorial"

The above is the detailed content of Is node.js a server language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn