码迷,mamicode.com
首页 > Web开发 > 详细

Node.js学习

时间:2015-10-19 17:42:54      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

What is Node.js?

什么是Node.js ?

Node.js is a server side platform built on Google Chrome‘s JavaScript Engine(V8 Engine). Node.js was developed by Ryan Dahl in 2009 and it‘s latest version is v0.10.36. Defintion of Node.js as put by its official documentation is as follows:

Node.js 是一个构建于 谷歌Chrome浏览器的JavaScript引擎(V8引擎)。Node.js是由Ryan Dahl于2009年开发,当前最新版本是v0.10.36。Node.js的官方文档中,是这样定义它的:

Node.js? is a platform built on Chrome‘s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Node.js 是一个构建于Chrome的JavaScript运行时,目的是快速构建,可扩展的网络应用。Node.js使用事件驱动模型,无阻塞IO模型,因此它是轻量级和高效的,完美运行于数据密集型的实施应用的分布式场景中。

Node.js is an open source, cross-platform Runtime Environment for server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.

Node.js 是一个开源的,跨平台的服务端运行环境和网络应用。Node.js应用开发使用JavaScript编写,并且可以运行于Node.js运行时环境无论是 OS X,Windows,还是Linux。

Node.js also provides a rich library of various JavaScript modules which eases the developement of web application using Node.js to a great extents.

Node.js 也提供了丰富的 由JavaScript编写的各种各样的内裤模型,这些模型使得 web 应用的开发在很大程度上边的轻松容易。

Node.js = Runtime Environment + JavaScript Library
Node.js 就是  运行时环境 和  JavaScript 内裤的组合

Features of Node.js

Node.js的特点

Following are few of the important features which are making Node.js as the first choice of software architects.

下面列出了一些让Node.js 作为软件架构的首选 的 一些 非常重要的的特性。

  • Asynchronous and Event Driven All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

    异步事件驱动: Node.js的所有的API的内裤都是异步的无阻塞的。也基本就是意味着使用Node.js构建的服务器永远不用等待API去返回数据。服务区在进行了一个API调用之后,继续进行下一个API的调用,Node.js通过事件通知机制 让服务器获取前面的API调用的返回结果。

  • Very Fast Being built on Google Chrome‘s V8 JavaScript Engine, Node.js library is very fast in code execution.

    运行特别快:构建于V8 JavaScript引擎,Node.js的代码执行效率特别高.

  • Single Threaded but highly Scalable - Node.js uses a single threaded model with event looping. Event mechanism helps server to respond in a non-bloking ways and makes server highly scalable as opposed to traditional servers which create limited threads to handle requests. Node.js uses a single threaded program and same program can services much larger number of requests than traditional server like Apache HTTP Server.

    单线程 但 具备高扩展性:Node.js使用具有事件轮询机制的单线程模型。事件机制帮助服务器去回应无阻塞方法,使服务器与传统的创建固定线程来响应请求的方法相比,具有更高的扩展性。Node.js使用单线程来运行,与传统的Apache HTTP服务器相比,处理的请求数远远超过传统服务器。

  • No Buffering - Node.js applications never buffer any data. These applications simply output the data in chunks.

    无缓冲:Node.js应用不会缓存任何数据。这些应用会简单的将数据进行块输出。

  • License - Node.js is released under the MIT license.

    许可证:Node.js发行,遵循MIT许可。

Who Uses Node.js?

Following is the link on github wiki containing an exhaustive list of projects, application and companies which are using Node.js. This list include eBay, General Electric, GoDaddy, Microsoft, PayPal, Uber, Wikipins, Yahoo!, Yammer and the list continues.

好多好多的知名企业都在使用Node.js

Concepts

概念

The following diagram depicts some important parts of Node.js which we will discuss in detail in the subsequent chapters.

下图描绘出了一些重要Node.js的组成部分。我们将在随后章节钟来讨论这些组成细节。

技术分享

Where to Use Node.js?

何处使用Node.js

Following are the areas where Node.js is proving itself a perfect technology partner.

以下内容,证明了Node.js是一个完美的技术合作伙伴。

  • I/O bound Applications

    IO 密集型应用

  • Data Streaming Applications

    数据流应用

  • Data Intensive Realtime Applications (DIRT)

    数据密集型实时应用

  • JSON APIs based Applications

    基于JSON作为API的应用

  • Single Page Applications

    简单的网页应用

Where Not to Use Node.js?

Node.js不适用的地方

It is not advisable to use Node.js for CPU intensive applications.

不建议 在CPU 密集型应用中 使用 Node.js


Node.js学习

标签:

原文地址:http://my.oschina.net/ski/blog/518919

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!