Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How node.js code works

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the relevant knowledge of how the node.js code runs, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how the node.js code runs. Let's take a look at it.

What exactly is the relationship between vue.js and node.js?

The first thing to install when learning vue is the node.js environment. So can vue.js run without node.js?

First, let's talk about node.js.

In terms of the front end, nodejs is of epoch-making significance.

Those who have never used nodejs are embarrassed to say that they are the front end.

The backend has never heard of nodejs.

Or can not tell the advantages and disadvantages of nodejs and java, nor is it a qualified backend.

Nodejs is not a js framework, so never think of it as a framework similar to jquery.

Nodejs is the js runtime, runtime environment, analogy to jvm in java

What was the beginning of java? there is no doubt that it was jvm. Since jvm,java, it has been possible to boast that it is "once written and run everywhere."

Whether you are windows or linux, you can run it as long as you have the corresponding version of jvm installed. Class file.

Similarly, the function of nodejs is the same as that of jvm, and it is also the running environment of js, no matter what operating system you are.

As long as you install the corresponding version of nodejs, you can use js to develop daemons.

This is of epoch-making significance, which means that js, which can only be played around on browsers, can be used for back-end development.

Since nodejs has given birth to a large number of front-end people who use js to do background development, these people are partial front-end "full-stack programmers".

So the question is, we vue development front-end, the browser can parse and run js code, also parse run js code, can the browser replace node.js?

So what can node.js do as a js runtime?

Can we run vue without node.js?

Answer the above questions:

① also parses and runs js code. Can browsers replace node.js?

From the previous understanding, it seems that javascrip can accomplish our daily interactions and seems to be able to do anything, but he also has things he can't do. Such as:

(1) when it comes to end-to-end applications, we need to manipulate files. Javascript in the browser cannot operate files. Although H6 provides API related to files, most of these API are limited to read-only levels. Unlike traditional languages such as java, by passing a path and then reading the corresponding files, to put it bluntly, you can't CURD files and folders.

(2) javascript on the browser side has no way to operate the operating system, such as getting the version of the operating system and so on.

What can ② node.js do as a js runtime?

First of all, node.js can be used as a background server, so for vue, can we use java as a background server without node.js? Of course not, for vue, as the back-end server of choice, of course node and java can be. But there are some things that java can't replace node.

Both npm and webpack depend on the node environment. For vue to use these, you need a node environment.

③, can we run vue without node.js?

Of course, as long as you don't use npm and webpack technology, you can use vue without node.

This is the end of this article on how node.js code works. Thank you for reading it! I believe you all have a certain understanding of "how the node.js code works". If you want to learn more, you are 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report