In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you whether node is a language, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
Node is not a language, node.js is an open source, cross-platform execution environment that can run JavaScript on the server side; node.js uses V8 code developed by Google to execute code, uses technologies such as event-driven, non-blocking and asynchronous I / O models to improve performance, and optimizes the transmission volume and scale of applications.
This article operating environment: Windows7 system, nodejs10.16.2 version, Dell G3 computer.
Is node a language?
Node is not a language.
Node.js is an open source, cross-platform execution environment that can run JavaScript on the server side. Node.js is owned and maintained by OpenJS Foundation (formerly Node.js Foundation, merged with JS Foundation) and is also a project of the Linux Foundation. Node.js uses V8 developed by Google to execute code, uses technologies such as event-driven, non-blocking and asynchronous input-output models to improve performance, and optimizes the transmission volume and scale of applications. These techniques are commonly used in data-intensive real-time applications.
Most of the basic modules of Node.js are written in JavaScript. Before the advent of Node.js, JavaScript was usually used as a client programming language, and programs written in JavaScript were often executed on users' browsers. The advent of Node.js enables JavaScript to also be used for server-side programming. Node.js contains a series of built-in modules that allow programs to be executed as stand-alone servers without Apache HTTP Server or IIS.
At present, Node.js has been adopted by IBM, Microsoft, Yahoo!, Walmart, Groupon, SAP [13], LinkedIn, Rakuten, PayPal, Voxer [18], GoDaddy and other enterprises.
Main function
The V8 engine itself uses some of the latest compilation techniques. This greatly improves the 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. Node takes advantage of this advantage to write a server with high scalability. Node uses an architecture called event Loop (event loop), which makes it easy and secure to write highly scalable servers. There are a variety of techniques for improving server performance. Node chose an architecture that not only improves performance but also reduces development complexity. This is a very important feature. Concurrent programming is often complex and landmine-ridden. Node bypasses these, but still provides good performance.
Node uses a series of "non-blocking" libraries to support event loops. In essence, it is to provide 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 (addressing and retrieving files), and the non-blocking interface notifies the Node when the hard disk is ready. The model simplifies the access to slow resources in an extensible way, which is intuitive and easy to understand. Especially for users who are familiar with onmouseover, onclick and other DOM events, there is a sense of deja vu.
While letting Javascript run on the server side is not unique to Node, it is one of its powerful features. Admittedly, the browser environment limits our freedom to choose a programming language. The desire to share code between any server 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 a de facto platform because of the above features.
Within a short time of launching Node, the community has contributed a large number of extension libraries (modules). Many of them are drivers that connect to databases or other software, but many of them are very useful software based on their strength.
Finally, I have to mention the Node community. Although the Node project is still very young, it is rare to see a community so enthusiastic about a project. Whether novice or expert, everyone revolves around the project, using and contributing their abilities to create a paradise to explore, support, share, and listen to advice.
Program example
An example of HTTP Server version of hello world written in Node.js:
Const http = require ('http'); http.createServer ((request, response) = > {response.writeHead (200,{' Content-Type': 'text/plain'}); response.end (' Hello Worldwaters');}) .clients (8000); console.log ('Server running at http://127.0.0.1:8000/');)
Another simple example of a TCP server that listens (Listening) to port 7000 and outputs (echo) previously entered messages:
Const net = require ('net'); net.createServer (stream = > {stream.write (' hello\ r\ n'); stream.on ('end', () = > stream.end (' goodbye\ r\ n')); stream.pipe (stream);}) .speak (7000). These are all the contents of the article "whether node is a language". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.