In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "what is nodejs used for?". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "what is nodejs used for?"
Nodejs is an open source, cross-platform running environment that can run JavaScript on the server side; Node.js uses V8 code developed by Google to run code, uses technology such as event-driven, non-blocking and asynchronous I / O model 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.
What does nodejs do?
Node.js is an open source, cross-platform running 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 code developed by Google to run 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 emergence of Node.js, JavaScript was usually used as a client programming language, and programs written in JavaScript were often run 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 run as stand-alone servers without Apache HTTP Server or IIS.
Nodejs introduction:
Node.js is a very hot technology at present, but its birth experience is very strange.
As we all know, just a few months after Netscape designed JavaScript, JavaScript is actually the only standard for front-end development.
Later, Microsoft beat Netscape through IE to unify the desktop, and as a result, browsers made no progress for several years. (the ancient IE 6 launched in 2001 is still in use today! )
Without competition, there will be no development. Microsoft thought the IE6 browser was so perfect that there was little room for improvement, and then disbanded the IE6 development team! On the other hand, Google believes that a new generation of browsers that support modern Web applications are just in their infancy, especially the performance of the engine that browsers are responsible for running JavaScript can be improved tenfold.
First Mozilla launched the Firefox browser in 2002 with the help of the Netscape legacy that has been sacrificed, and then Apple launched the WebKit kernel Safari browser based on the open source KHTML browser in 2003, but only on the Mac platform.
Later, Google began to create its own browser. They also took a fancy to the WebKit kernel, so they launched the Chrome browser based on the WebKit kernel.
Chrome browsers span Windows and Mac platforms, and Google believes that to run modern Web applications, browsers must have a very powerful JavaScript engine, so Google developed its own high-performance JavaScript engine, called V8, open source under the BSD license.
The modern browser war left Microsoft's IE browsers far behind because they disbanded the most experienced and effective browser team! Looking back and catching up, we found that WebKit, which supports HTML5, has become the standard on the mobile side, and IE browsers have been insulated from the mainstream mobile devices.
What does the browser war have to do with Node?
It is said that there is a foreigner named Ryan Dahl whose job is to write high-performance Web services with C _ blank +. For high performance, asynchronous IO and event-driven are the basic principles, but it is too painful to write with C _ password. So this guy began to imagine developing Web services in a high-level language. He evaluated many high-level languages and found that although many languages provide both synchronous IO and asynchronous IO, once developers use synchronous IO, they no longer bother to write asynchronous IO, so in the end, Ryan is aimed at JavaScript.
Because JavaScript is executed in a single thread and cannot perform synchronous IO operations at all, this "flaw" of JavaScript causes it to use only asynchronous IO.
The development language is selected, and there is also a run-time engine. This guy thought about writing one himself, but wisely gave up, because V8 is the open source JavaScript engine. Let Google invest to optimize V8. We are only responsible for transforming it and using it. We don't have to pay for it. It's a good deal.
So in 2009, Ryan officially launched an open source Web server project based on the JavaScript language and V8 engine, named Node.js. Although the name is corny, Node brought JavaScript to back-end server development for the first time, and there are already countless JavaScript developers in the world, so Node suddenly became popular.
What are the advantages of JavaScript running on Node over other back-end development languages?
The biggest advantage is that it is easy to write high-performance Web services with the help of JavaScript's natural event-driven mechanism and V8 high-performance engine.
Second, the JavaScript language itself is a perfect functional language, in front-end development, developers tend to write more casually, making people feel that JavaScript is a "toy language". However, in the Node environment, through modular JavaScript code, coupled with functional programming, and do not consider the browser compatibility, directly use the latest ECMAScript 6 standard, can fully meet the needs of the project.
I've also heard of io.js. What the heck is this?
Because Node.js is an open source project, although driven by the community, it has been funded by Joyent behind the scenes. Due to a group of developers dissatisfied with Joyent's strategy, the io.js project was launched from the Node.js project fork in 2014 and decided to develop separately, but the two are actually compatible.
However, there is an old Chinese saying, "if you divide for a long time, you must be divided." Not long after the separation, Joyent said it wanted to settle, so the io.js project decided to return to Node.js.
The specific approach is that in the future, io.js will first add new features, and if you test it well, add new features to Node.js. Io.js is a "tasting version", while Node.js is an online stable version, which is equivalent to the relationship between Fedora Linux and RHEL.
The above is all the content of this article "what is nodejs used for?" 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.