节点与节点之间的通信 c#_节点和浏览器之间的区别

节点与节点之间的通信 c#

Both the browser and Node use JavaScript as their programming language.

浏览器和Node均使用JavaScript作为其编程语言。

Building apps that run in the browser is a completely different thing than building a Node.js application.

构建在浏览器中运行的应用程序与构建Node.js应用程序完全不同。

Despite the fact that it’s always JavaScript, there are some key differences that make the experience radically different.

尽管事实始终是JavaScript,但仍存在一些关键差异,使体验完全不同。

As a frontend developer who extensively uses Javascript, Node apps brings with it, a huge advantage - the comfort of programming everything, the frontend and the backend, in a single language.

作为广泛使用Javascript的前端开发人员,Node应用程序带来了巨大的优势-使用单一语言轻松编程所有内容(前端和后端)。

You have a huge opportunity because we know how hard it is to fully, deeply learn a programming language, and by using the same language to perform all your work on the web - both on the client and on the server, you’re in a unique position of advantage.

您拥有巨大的机会,因为我们知道全面,深入地学习一种编程语言并通过使用相同的语言在网络上执行所有工作(无论是在客户端还是在服务器上)都非常困难。独特的优势地位。

What changes is the ecosystem.

改变的是生态系统。

In the browser, most of the time what you are doing is interacting with the DOM, or other Web Platform APIs like Cookies. Those do not exist in Node, of course. You don’t have the document, window and all the other objects that are provided by the browser.

在浏览器中,大多数时候您正在做的是与DOM或其他Web平台API(例如Cookies)进行交互。 当然,那些在Node中不存在。 您没有documentwindow以及浏览器提供的所有其他对象。

And in the browser, we don’t have all the nice APIs that Node.js provides through its modules, like the filesystem access functionality.

而且在浏览器中,我们没有Node.js通过其模块提供的所有不错的API,例如文件系统访问功能。

Another big difference is that in Node.js you control the environment. Unless you are building an open source application that anyone can deploy anywhere, you know which version of Node you will run the application on. Compared to the browser environment, where you don’t get the luxury to choose what browser your visitors will use, this is very convenient.

另一个很大的不同是,在Node.js中,您可以控制环境。 除非您构建任何人都可以在任何地方部署的开源应用程序,否则您将知道将在哪个版本的Node上运行该应用程序。 与浏览器环境相比,在浏览器环境中,您无法选择访客会使用的浏览器,这非常方便。

This means that you can write all the modern ES6-7-8-9 JavaScript that your Node version supports.

这意味着您可以编写您的Node版本支持的所有现代ES6-7-8-9 JavaScript。

Since JavaScript moves so fast, but browsers can be a bit slow and users a bit slow to upgrade, sometimes on the web, you are stuck to use older JavaScript / ECMAScript releases.

由于JavaScript的运行速度如此之快,但是浏览器可能会变慢,用户的升级会变慢,有时是在网络上,因此您不得不使用较旧JavaScript / ECMAScript版本。

You can use Babel to transform your code to be ES5-compatible before shipping it to the browser, but in Node, you won’t need that.

您可以使用Babel将代码转换为与ES5兼容,然后再将其发送到浏览器,但是在Node中,则不需要这样做。

Another difference is that Node uses the CommonJS module system, while in the browser we are starting to see the ES Modules standard being implemented.

另一个区别是Node使用CommonJS模块系统 ,而在浏览器中,我们开始看到正在实现ES模块标准。

In practice, this means that for the time being you use require() in Node and import in the browser.

实际上,这意味着您暂时在Node中使用require()import浏览器中。

翻译自: https://flaviocopes.com/node-difference-browser/

节点与节点之间的通信 c#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值