加载中

node.js tutorials

Read on if you are looking for resources and tutorials to learn Node.js. We would be covering Node.js tutorial for Real Time chat application, writing API services, Polling app creation, Character voting app, Social authentication, Node.js on Raspberry Pi and many more.

Given below is brief introduction of Node.js for beginners, you can skip directly to the Node.js tutorials if you already know the basics of Node.js.

What is Node.js ?

Node.js is the most used server side JavaScript runtime environment till date and is used for developing cross platform real time web applications in JavaScript. 

Node.js is powered by the open source V8 JavaScript engine of Google and works on an event driven, non-blocking input-output model which makes it efficient and lightweight.

node.js tutorials

如果你正在找Node.js的学习资料及指南,那么请继续(阅读),我们的教程将会覆盖即时聊天应用、API服务编写、投票问卷应用、人物投票APP、社交授权、 Node.js on Raspberry Pi等等。

以下是Node.js入门的简单介绍,如果你对Node.js略有了解可以直接跳过此部分。

那什么是Node.js呢?

Node.js是迄今运用最多的服务端JavaScript运行时环境,使用JavaScript开发跨平台的实时WEB应用。

Node.js基于Google的V8 JavaScript引擎。基于事件驱动,非阻塞的输入输出模型,这也使得其高效而轻量。

The power of node.js lies in its ability to support data intensive interactive applications that function around user events and deal with data I/O and data streaming. Node.js also works magical when it comes to JSON APIs and is the heart and soul of single page web applications. 

The popularity of Node.js can be gauged from the fact that big brands like eBay, target, City Group, Sony, Uber, LinkedIn, Medium, and Netflix too have used Nodejs for one or the other web development project.

How to Learn Node.js ?

Developers across the globe use Node.js for developing complex interactive and data intensive web apps and websites. There is no dearth of great resources and tutorials that teach you how to build your own Node.js applications.

Let us look at the best Tutorials around the web written by Node.js experts for creating kick-ass web apps.

We will cover introductory Node.js tutorials for beginners, intermediate level Node.js tutorials and also the tutorials that teach how to build complex Node.js applications.

Node.js的强大之处在于其能力支持数据密级性的交互应用,因为这类应用的函数围绕着用户事件,数据I/O和数据流的处理。对于JSON的API,Node.js同样显得很神奇,它是单页WEB应用的心脏和灵魂。

Node.js的流行程度可以感觉得到,像eBay、target、City Group、Sony、Uber、LinkedIn、Medium、Netflix等等的大公司都有在他们的web项目中应用。

怎样学习Node.js呢?

Node.js的开发者来自全球,他们用Node.js开发复杂交互的,数据密集型的WEB Apps和网站。同时网上有着大量的资源和教程教你怎样构建自己的Node.js应用。

我们不防看看Node.js大神针对Web Apps写的Node.js最佳指南。

我们所覆盖的指南将包括针对初学者的Node.js、中级指南,同时还有教你怎样构建复杂的Node.js项目。

For the absolute node.js beginners, it is good to go through the step by step guides like the one on Tutorials point, or the Node.js tutorial on airpair.com before diving deep into fully functional example projects that are covered later in this article. Nodeschool.io is another great website with tons of resources to learn basics of node.js and related technologies.

Real Time Chat App with Node.js, Express and Socket.io

The best way to learn the depths of any new technology is by creating a fully functional application. In this tutorial you will learn to build a real time chat application using Node.js Express framework and socket.io that enables event based bidirectional communication. In this tutorial, you will also get to work with JavaScript template engine named Jade.

Tutorial is written by Krasimir Tsonev on tutsplus.com and covers all aspects of end to end app building, starting with node.js environment setup, backend server development using Express framework, and finally the front end UI development using Jade template engine.

You can follow this tutorial here at:  Node.js Tutorial – Real Time Chat.

对于完全的Node.js初学者,  在深入挖掘本文章后续提到的学习项目之前,一步步按照airpair.com上面入门指南的要点Node.js入门指南 之类的文章学习是不错的选择。Nodeschool.io是另一个比较好的网站,上面有着非常多的资料,可以学习基本的node.js及相关的技术。

通过Express框架和Socket.io构建即时通讯APP

将一个新技术学到一定高度的最好方式就是通过功能性的应用了。在这个指南中,你将学习使用Express框架和Socket.io构建即时通讯应用,这些技术可以使用基于事件的双向通信。在这个指南中,你还将使用JavaScript模板引擎Jade。

我们要介绍的指南由Krasimir Tsonev所撰写,发布在tutsplus.com上面,从node.js的环境搭建,使用Express框架的后端服务,到最后使用Jade模板引擎的前端UI开发,覆盖了所有前端到后端的方方面面。

你可以在后面这个链接中找到这篇指南:  即时通讯(Node.js Tutorial – Real Time Chat) .

Restful API in Node.js Using Swagger

This is another well written tutorial for learning node.js that explains how to write rest API services using Swagger and covers the end to end CRUD (Create, Read, Update, Delete) cycle. This tutorial is written by Samuela Zara on scotch.io and provides step by step instructions to create Restful API to manage movies collection.

If you haven't heard of Swagger, it is the most powerful framework that enforces specifications when it comes to documenting REST APIs. It offers interactive documentation, client side sdk generation and discoverability so that your APIs are easily discovered, described and used by developers. 

In this tutorial Samuela starts of with setting up Swagger module for Node.js, then uses the mock mode feature, which helps you start off with the APIs setup without writing single line of code. Once the structure is in place then you implement APIs for Get movie, Update movie, Add movie and Delete movie.

You can find this tutorial here at - Restful API in Node.js using Swagger.

使用Swagger创建Restful API

这个精心设计的教程解释了如何使用Swagger来创建Rest API,并且包括了Rest API应该支持的所有操作(CRUD,创建,查询,更新,删除)。这个例子是由来自scotch.io的Samuela Zara提供的,它实现了管理电影集合的Rest API。

Swagger是一个非常强大的框架来描述REST APIs,它提供了交互式的API文档编辑,客户端sdk生成以及发现服务。通过使用Swagger,你所书写的API将更容易被大家所理解并且使用。

在这个教程中,Samuela一开始先教会大家如何安装node.js的Swagger模块,然后介绍了Swagger提供的模拟模式。通过这个模式,API开发者可以先集中精神进行API本身的设计,而不用写一行的代码。当这个API结构被设计完成之后,教程开始带领大家具体实现获取电影,增加/修改电影以及删除电影的操作。

你可以通过Restful API in Node.js using Swagger这个链接来访问该教程。

API Services in Node.js Using Nodal

With tons of modules and frameworks around, you would never need to build any project from scratch in plain JavaScript/Node.js. For multi-platform (mobile, web, IOT) product development, service oriented architecture is the key and this tutorial takes you a step closer to that.

In this tutorial, Keith Horwood utilizes Nodal framework to create API services in Node.js and makes it look damn easy. Nodal is an extensible full service opinionated framework that helps speed up data centric APIs creation in Node.js.

In this tutorial you will setup node.js environment, install Nodal, setup postgreSQL before getting into coding the Model, Controller and Views.

You can find this tutorial here at: API Services in Node.js Using Nodal.

在 Node.js 中使用 Nodal 建立 API Services

在大多数模块和框架之上,你就不会需要再建立任何简陋的 JavaScript/Node.js 项目。为了多平台(移动端,web,IOT)产品开发,面向服务的架构是关键的,而本教程就将带你更进一步。

在本教程中,Keith Horwood 利用 Nodal 框架在 Node.js 中来创建 API services,并让这一切看起来极其简单。Nodal 是一个可扩展的,以意见为依据的全服务框架,它帮助数据中心加快在 Node.js 基础上的API创建。

在本教程中,你将会在开发 MVC (模型,控制器和视图)之前安装 node.js 环境,安装 Nodal 和 postgreSQL。 

你可以在这里找到本教程: 在 Node.js 中使用 Nodal 建立 API Services.


Node.js Apps - Social Authentication with Passport

Social authentication is used almost everywhere since most of the people have accounts in one or the other social networks like Facebook, Twitter and Google. Authentication using social networking works like single sign on where you use your existing social network credentials and login to other applications.

In this tutorial you build a simple Node.js application and use social authentication for login using Passport as middleware. This tutorial is written by Agraj Mangal on tutsplus.com. 

You can follow this link for the tutorial - Node.js Apps - Social Authentication with Passport.

Polling App using Rethink DB and Node.js

This tutorial is mostly for beginners who have basic understanding of Node.js. In this tutorial you learn Node.js by building a simple polling app that gives users three choices to vote and provides live updates of the vote count.

Angular and angural material design library is used for front end design of the application, Node.js is used as the server and rethinkDB is used to store voting and user related data. 

You end up building a simple application while covering all aspects of end to end app creation.  

You can find this tutorial here at - Polling App using Rethink DB and Node.js.

Node.js Apps - 使用通行证进行社交认证

社交认证几乎随处可见,因为我们绝大多数人在Facebook 、Twitter和Google这样的某个社交网络上都有自己的账号。社交网络认证的工作过程是使用已有的社交网络证书进行单点登录,同时可以登录到其它的程序。

在本教程中,你会构建一个简单的Node.js程序,通过使用通行证作为中间件使用社交认证进行登录。本教程由Agraj Mangal编写,发表在tutsplus.com网站上。

要获得本教程可访问链接Node.js Apps - Social Authentication with Passport.

使用Rethink DB和Node.js开发投票App

本教程主要针对的是对Node.js有基本理解的初学者。在本教程中,你能通过开发一个简单的投票app学习Node.js,该程序给用户提供投票的三个选项,并提供投票人数的实时更新。

Angular和angural素材设计库用于程序的前端设计,Node.js用于服务器端,rethink DB用来存储投票数据和相关联的用户数据。

通过编写完成这样一个简单的程序,你就可以掌握创建整个程序的方方面面。

要获得本教程可访问- Polling App using Rethink DB and Node.js.

Character Voting App – Node.js, React, MongoDB and Socket.io

This one is a must read tutorial for advanced level programming and definitely not among the easiest node.js examples for beginners to learn. It is a well-organised tutorial written by Sahat Yalkabov and is nothing less than a fully functional project for building a character voting app for online multiplayer game – Eve Online. Eve online is multiplayer online game where each player is represented by a 3D avatar. 

Tutorial covers building REST API using Node.js Express framework, saving and retrieving data from MongoDB, real time online visitors tracking using Socket.io, server side rendering with React ( and Flux) and finally deploying the application in the cloud. In this tutorial, you end up building an app for ranking avatars for Eve online and learn about multiple technologies in an interesting and fun way.

You can find this tutorial here at - Character Voting App – Node.js, React, MongoDB and Socket.io

角色投票系统 – Node.js, React, MongoDB and Socket.io

这个教程是为有一定基础的nodejs开发人员量身定做的,如果你是一个nodejs的初学者,那么这个教程并不适合阅读。这是一篇由Sahat Yalkabov编写的经过精心组织的教程,目的是为多人在线游戏(Eve Online)开发一个角色投票应用,这是一个功能完整的项目Eve Online是一个多人在线游戏,每个玩家都有一个3D形象来代表他们的角色。

这篇教程覆盖了一下这些内容:使用Node.js Express 框架创建REST API, 使用MongoDB进行数据的存储,使用Socket.IO实时跟踪在线的访问者,使用React(和Flux)进行服务器端的页面绘制,并且最终将这个引用部署到云端。通过这个教程,你不仅能建成一个对Eve Online进行角色头像投票的系统,而且还可以通过充满乐趣的方式学习到许多的知识。

你可以通过下面的链接访问这个教程 - Character Voting App – Node.js, React, MongoDB and Socket.io

WI-FI Dashboard Using Node.js and Reactive.js

This tutorial is written by Marcello La Rocca on Sitepoint.com and is for intermediate level Node.js programming. Marcello takes lead from the previous tutorial in the series and moves ahead with building a dashboard and adding more information about the available Wi-Fi connections around.

In this tutorial, you implement a server that runs on Ubuntu, a minor modification and it can run on windows and mac too. The server implementation is extended from the previous tutorial of Marcello - Creating Battery viz using Node.js. After implementing server, you write client, and the user interface to present Wi-Fi list using HTML template.

You can find this tutorial here at - WI-FI Dashboard Using Node.js and Reactive.js.

使用 Node.js 和 Reactive.js 的 WI-FI 仪表板

这个教程是由 Marcello La Rocca 在 Sitepoint.com 上编写的,适合中级的 Node.js 编程者。Marcello 的引领来自之前的系列教程,它还引导建立了一个仪表板添加更多关于周围可连接 Wi-Fi 的信息。

在这个教程中,你实现的服务器运行在Ubuntu上,做一点小修改也可以运行在windows和mac上。服务器实现的扩展来自于 Marcello 之前的教程 - 使用 Node.js创建电池。实现服务器搭建之后,你编写客户端和用户接口并使用HTML模板给当前的 Wi-Fi 列表。

你可以找到这个教程 使用 Node.js 和 Reactive.js 编写 WI-FI 仪表板

Test Driven Development – Node.js and Mocha

This tutorial is brought to you by Semaphoreci.com, in this tutorial you learn how to use Mocha library for unit and integration testing.

Mocha is JavaScript test framework that runs in browser and on Nodejs and helps in asynchronous testing. Mocha tests are serial in nature and map uncaught exceptions to the right test cases.

You setup empty project with node package manager npm and then install mocha library. The node.js example app in this tutorial is a color converter that translates RGB to hexadecimal color representation. Finally web server is created to test workings of asynchronous code.

You can find this tutorial here at - Test Driven Development – Node.js and Mocha.

测试驱动的开发 - Node.js 和 Mocha

这篇由Semaphoreci.com提供的教程将交会你如何使用Mocha来进行单元测试和集成测试。

Mocha是一个JavaScript测试框架,它既可以运行在浏览器中,也可以运行在Nodejs环境中。Mocha将按照顺序执行所有的测试,并将出现的未捕获异常映射到相应的测试用例上。

你可以通过使用npm来引入mocha模块。这个教程中的例子实现了一个颜色转换程序,这个程序将RGB转换成16进制形式。这个教程还创建了一个web服务器来测试异步代码。

你可以通过下面的链接Test Driven Development – Node.js and Mocha找到这个教程。

Node.js on Raspberry Pi

This Node.js tutorial is part of the learning through making series written by Dave Johnson on thisdavej.com. In this tutorial you will learn to install Node.js on Raspberry Pi2 and Pi3. This tutorial mostly focuses on Raspberry Pi setup with node.js installation in towards the end.

After going through this tutorial, you can follow further tutorials in this series to get going with Node.js on Raspberry Pi, tutorials include "exposing Raspberry Pi web server on the internet using node.js" and "creating web server with node without coding".

You can find this and other related tutorials here at - Node.js on Raspberry Pi.

Node.js Tutorial: Building Sentiment Analysis App

Here is another great tutorial written by Scott Rich on IBM developerWorks. This tutorial uses Node.js, Express framework, Sentiment module and ntwitter module to build a small application to do sentiment analysis based on tweets.  

In this tutorial, you setup Express framework, run and test Hello Node.js app to ensure everything works, add sentiment analysis to the application, connect application to twitter, and finally get everything together for a fully functional application.  

You can find this tutorial here at – Twitter Sentiment Analysis App in Node.js.

在树莓派上使用Node.js

这篇Node.js教程是"在创造中学习"(learning through making)系列的一部分,该系列由Dave Johnson编写,发表在thisdavej.com网站上。通过本教程,你能学会在树莓派2和树莓派3上安装Node.js。本教程自始至终主要关注的是在树莓派上安装Node.js。 学完本教程后,你可以进一步学习本系列中的其它教程,以便学会在树莓派上使用Node.js,教程包括“探索使用Node.js在树莓派上创建因特网web服务器”和“不用编码而只使用node.js创建web服务器”。

要获得本教程和其它相关的教程可访问Node.js on Raspberry Pi

Node.js教程:开发情绪分析应用

这是另一篇优秀的教程,由Scott Rich编写,发表在IBM developerWorks上。本教程使用Node.js, Express框架, Sentiment模块和ntwitter模块开发了一个基于推特进行情绪分析的小型程序。 在本教程中,你将学习设置express框架,运行并测试hello Node.js程序,以确保框架工作正常,为程序添加情绪分析功能,并将程序连接到twitter,最后将它们整合在一起,以形成一个功能完整的程序。

Twitter Sentiment Analysis App in Node.js上可以找到这篇教程。

返回顶部
顶部