为什么要在下一个项目中使用Node.js?

There are tons of alternatives to Node.js when it comes to building any kind of software.

构建任何类型的软件时,Node.js都有许多替代方案。

Why is Node.js a good choice?

为什么Node.js是一个不错的选择?

In this post I’ll tell you some good reasons to use it.

在这篇文章中,我将告诉您一些使用它的充分理由。

Node.js是JavaScript (Node.js is JavaScript)

JavaScript is probably the most popular programming language in the world.

JavaScript可能是世界上最受欢迎的编程语言。

It is the only language that can run inside a Web Browser, which gives it a unique point of advantage over any other language.

它是唯一可以在Web浏览器中运行的语言,这使其比其他任何语言都有独特的优势。

With the rise of React Native, Electron and similar solutions, it’s also the only language which you can use to create web apps, frontend and backend, mobile apps, desktop apps.

随着React Native,Electron和类似解决方案的兴起,它也是可用于创建Web应用程序,前端和后端,移动应用程序,桌面应用程序的唯一语言。

It’s pretty universal, and once you master the JavaScript language in one area, your skills can be easily ported into another area and you just need to learn the environment differences (for example, how to use React Native rather than Electron, or the DOM).

它非常通用,一旦您在一个区域掌握了JavaScript语言,就可以轻松地将技能移植到另一个区域,而您只需要学习环境差异(例如,如何使用React Native而不是Electron或DOM) 。

This is something you will not find anywhere else.

这是您在其他任何地方都找不到的东西。

Plus, JavaScript is an amazing and flexible language to work with.

另外,JavaScript是一种很棒的灵活语言。

If you already know JavaScript because you work in the browser, then it’s a no-brainer to pick Node.js.

如果您因为在浏览器中工作而已经知道JavaScript,那么选择Node.js无疑是很容易的。

Node.js是事件驱动的单线程 (Node.js is event driven and single threaded)

What does this mean? In short, it can handle heavy load very well.

这是什么意思? 简而言之,它可以很好地应对重载。

Every single Node.js program can manage a lot of concurrent connections, and still be very fast because of its non-blocking I/O nature.

每个Node.js程序都可以管理许多并发连接,并且由于其非阻塞I / O性质而仍然非常快。

This means that you have all the tools in place to build a very performant system, out of the box.

这意味着您可以立即使用所有工具来构建性能卓越的系统。

This has a few side effects.

这有一些副作用。

First, you’ll find the solution to any kind of problem discussed online. The community is huge and very helpful.

首先,您将找到在线讨论的任何问题的解决方案。 社区很大,非常有帮助。

It’s easy to get started, and there are many resources to learn from.

它很容易上手,并且有很多资源可以学习。

Second, there is a library for everything.

其次,这里有一个图书馆。

The npm repository has a huge set of ready-to-use libraries, available with a simple npm install command.

npm存储库具有大量现成的库,可通过简单的npm install命令获得。

Thanks to this popularity, a vicious cycle is set up: your favorite API might only offer an official Node.js library, and other languages are not even considered, left for unofficial packages (with varying level of quality).

由于这种流行,建立了一个恶性循环:您最喜欢的API可能仅提供了官方的Node.js库,甚至不考虑其他语言,而留给了非官方的软件包(质量级别各不相同)。

您可以轻松部署Node.js应用 (You can easily deploy Node.js apps)

Some programming environments require a dedicated setup, even for simple projects, because no one has built an ecosystem around them.

某些编程环境甚至对于简单项目也需要专用的设置,因为没有人围绕它们建立生态系统。

Heroku famously made Rails applications development simple, and today in Node.js we have other solutions that are comparable.

Heroku著名地简化了Rails应用程序的开发,今天在Node.js中,我们还有其他类似的解决方案。

I am thinking about Zeit Now.

我正在考虑Zeit Now

When I want a place to easily set up a sample Node.js application and share it with the world, I think about Glitch (hint: it can also run private apps).

当我想在某个地方轻松设置示例Node.js应用程序并将其与世界共享时,我想到了Glitch (提示:它也可以运行私有应用程序)。

翻译自: https://flaviocopes.com/node-when-to-use/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值