【nodejs】1. Introduction to Node.js ,nodejs官网教程翻译

Introduction to Node.js

Node.js 简介

Node.js is an open-source and cross-platform JavaScript runtime environment. It is a popular tool for almost any kind of project!

Node.js 是一个开源、跨平台的 JavaScript 运行时环境。 它是几乎适用于任何类型项目的流行工具!

Node.js runs the V8 JavaScript engine, the core of Google Chrome, outside of the browser. This allows Node.js to be very performant.

Node.js 在浏览器外部运行 V8 JavaScript 引擎,这是 Google Chrome 的核心。 这使得 Node.js 具有非常高的性能。

A Node.js app runs in a single process, without creating a new thread for every request. Node.js provides a set of asynchronous I/O primitives in its standard library that prevent JavaScript code from blocking and generally, libraries in Node.js are written using non-blocking paradigms, making blocking behavior the exception rather than the norm.

Node.js 应用程序在单个进程中运行,无需为每个请求创建新线程。 Node.js 在其标准库中提供了一组异步 I/O 原语,可防止 JavaScript 代码阻塞,并且通常 Node.js 中的库是使用非阻塞范例编写的,这使得阻塞行为成为例外而不是常态。

When Node.js performs an I/O operation, like reading from the network, accessing a database or the filesystem, instead of blocking the thread and wasting CPU cycles waiting, Node.js will resume the operations when the response comes back.

当 Node.js 执行 I/O 操作(例如从网络读取、访问数据库或文件系统)时,Node.js 不会阻塞线程并浪费 CPU 周期等待,而是会在响应返回时恢复操作。

This allows Node.js to handle thousands of concurrent connections with a single server without introducing the burden of managing thread concurrency, which could be a significant source of bugs.

这使得 Node.js 能够通过单个服务器处理数千个并发连接,而不会引入管理线程并发的负担,而管理线程并发可能是错误的重要来源。

Node.js has a unique advantage because millions of frontend developers that write JavaScript for the browser are now able to write the server-side code in addition to the client-side code without the need to learn a completely different language.

Node.js 具有独特的优势,因为数百万为浏览器编写 JavaScript 的前端开发人员现在除了客户端代码之外还可以编写服务器端代码,而无需学习完全不同的语言。

In Node.js the new ECMAScript standards can be used without problems, as you don’t have to wait for all your users to update their browsers - you are in charge of deciding which ECMAScript version to use by changing the Node.js version, and you can also enable specific experimental features by running Node.js with flags.

在 Node.js 中,可以毫无问题地使用新的 ECMAScript 标准,因为您不必等待所有用户更新其浏览器 - 您负责通过更改 Node.js 版本来决定使用哪个 ECMAScript 版本, 您还可以通过运行带有标志的 Node.js 来启用特定的实验性功能。

  • 30
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值