Javascript 我如何开始使用 Node.js
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2353818/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I get started with Node.js
提问by Joneph O.
Are there any good resources to get started with Node.JS? Any good tutorials, blogs or books?
是否有任何好的资源可以开始使用 Node.JS?有什么好的教程、博客或书籍吗?
Of course, I have visited its official website http://nodejs.org/, but I didn't think the documentation they have is a good starting point.
当然,我访问了它的官方网站http://nodejs.org/,但我不认为他们拥有的文档是一个好的起点。
回答by yojimbo87
Tutorials
教程
- NodeSchool.io interactive lessons
- The Art of Node (an introduction to Node.js)
- Hello World
- Hello World Web Server(paid)
- Node.js guide
- Build a blog with Node.js, express and MongoDB
- Node.js for Beginners
- Learn Node.js Completely and with Confidence
- Node JS Processing Model – Single Threaded Model with Event Loop Architecture
- RisingStack's Node Hero Series
- Great Node.js tutorials voted by the programming community
- Node.js Recipes
- NodeSchool.io 互动课程
- Node 的艺术(Node.js 简介)
- 你好,世界
- Hello World Web 服务器(付费)
- Node.js 指南
- 使用 Node.js、express 和 MongoDB 构建博客
- 初学者的 Node.js
- 完全自信地学习 Node.js
- Node JS 处理模型——具有事件循环架构的单线程模型
- RisingStack 的节点英雄系列
- 由编程社区投票的优秀 Node.js 教程
- Node.js 食谱
Developer Sites
开发者网站
Videos
视频
- Node Tuts(Node.js video tutorials)
- Einführung in Node.js (in German)
- Introduction to Node.js with Ryan Dahl
- Node.js: Asynchronous Purity Leads to Faster Development
- Parallel Programming with Node.js
- Server-side JavaScript with Node, Connect & Express
- Node.js First Look
- Node.js with MongoDB
- Ryan Dahl's Google Tech Talk
- Real Time Web with Node.js
- Node.js Tutorials for Beginners
- Pluralsight courses (paid)
- Udemy Learn and understand Nodejs (paid)
- The New Boston
- Node Tuts(Node.js 视频教程)
- Node.js 中的 Einführung(德语)
- 与 Ryan Dahl 一起介绍 Node.js
- Node.js:异步纯净带来更快的开发
- 使用 Node.js 进行并行编程
- 带有 Node、Connect 和 Express 的服务器端 JavaScript
- Node.js 初看
- Node.js 与 MongoDB
- Ryan Dahl 的 Google 技术讲座
- 使用 Node.js 的实时网络
- Node.js 初学者教程
- Pluralsight 课程(付费)
- Udemy 学习和理解 Nodejs(付费)
- 新波士顿
Screencasts
截屏视频
Books
图书
- The Node Beginner Book
- Mastering Node.js
- Up and Running with Node.js
- Node.js in Action
- Smashing Node.js: JavaScript Everywhere
- Node.js & Co. (in German)
- Sam's Teach Yourself Node.js in 24 Hours
- Most detailed list of free JavaScript Books
- Mixu's Node Book
- Node.js the Right Way: Practical, Server-Side JavaScript That Scale
- Beginning Web Development with Node.js
- Node Web Development
- NodeJS for Righteous Universal Domination!
- 节点初学者书
- 掌握 Node.js
- 使用 Node.js 启动并运行
- Node.js 在行动
- 粉碎 Node.js:JavaScript 无处不在
- Node.js & Co.(德语)
- Sam 在 24 小时内自学 Node.js
- 最详细的免费 JavaScript 书籍列表
- Mixu的节点书
- Node.js 的正确方式:可扩展的实用服务器端 JavaScript
- 使用 Node.js 开始 Web 开发
- 节点网络开发
- NodeJS 为正义的普遍统治!
Courses
培训班
Blogs
博客
Podcasts
播客
JavaScript resources
JavaScript 资源
- Crockford's videos(must see!)
- Essential JavaScript Design Patterns For Beginners
- JavaScript garden
- JavaScript Patternsbook
- JavaScript: The Good Partsbook
- Eloquent javascript book
Node.js Modules
Node.js 模块
- Search for registered Node.js modules
- A curated list of awesome Node.js libraries
- Wiki List on GitHub/Joyent/Node.js(start here last!)
Other
其他
- JSApp.US - like jsfiddle, but for Node.js
- Node with VJET JS (for Eclipse IDE)
- Production sites with published source:
- Useful Node.js Tools, Tutorials and Resources
- Runnable.com - like jsfiddle, but for server side as well
- Getting Started with Node.js on Heroku
- Getting Started with Node.js on Open-Shift
- Authentication using Passport
回答by Nevir
First, learn the core concepts of Node.js:
首先,学习Node.js的核心概念:
Then, you're going to want to see what the community has to offer:
然后,你会想看看社区提供了什么:
The gold standard for Node.js package management is NPM.
Node.js 包管理的黄金标准是NPM。
It is a command line tool for managing your project's dependencies.
NPM is also a registry of pretty much every Node.js package out there
Finally, you're going to want to know what some of the more popular packages are for various tasks:
最后,您将想知道用于各种任务的一些更流行的软件包是什么:
Useful Tools for Every Project:
每个项目的有用工具:
- Underscorecontains just about every core utility method you want.
- Lo-Dashis a clone of Underscore that aims to be faster, more customizable, and has quite a few functions that underscore doesn't have. Certain versions of it can be used as drop-in replacements of underscore.
- TypeScriptmakes JavaScript considerably more bearable, while also keeping you out of trouble!
- JSHintis a code-checking tool that'll save you loads of time finding stupid errors. Find a plugin for your text editor that will automatically run it on your code.
- Underscore包含您想要的几乎所有核心实用方法。
- Lo-Dash是 Underscore 的克隆,旨在更快、更可定制,并且具有很多 underscore 没有的功能。它的某些版本可以用作下划线的替代品。
- TypeScript使 JavaScript 更容易忍受,同时也让您远离麻烦!
- JSHint是一种代码检查工具,可以为您节省大量查找愚蠢错误的时间。为您的文本编辑器找到一个插件,它会自动在您的代码上运行它。
Unit Testing:
单元测试:
- Mochais a popular test framework.
- Vowsis a fantastic take on asynchronous testing, albeit somewhat stale.
- Expressois a more traditional unit testing framework.
- node-unitis another relatively traditional unit testing framework.
- AVAis a new test runner with Babel built-in and runs tests concurrently.
- Mocha是一种流行的测试框架。
- Vows是异步测试的绝佳选择,尽管有些陈旧。
- Expresso是一个更传统的单元测试框架。
- node-unit是另一个相对传统的单元测试框架。
- AVA是一个新的测试运行器,内置 Babel 并同时运行测试。
Web Frameworks:
网络框架:
- Express.jsis by far the most popular framework.
- Koais a new web framework designed by the team behind Express.js, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs.
- sails.jsthe most popular MVC framework for Node.js, and is based on express. It is designed to emulate the familiar MVC pattern of frameworks like Ruby on Rails, but with support for the requirements of modern apps: data-driven APIs with a scalable, service-oriented architecture.
- Meteorbundles together jQuery, Handlebars, Node.js, WebSocket, MongoDB, and DDP and promotes convention over configuration without being a Ruby on Railsclone.
- Tower(deprecated) is an abstraction of a top of Express.js that aims to be a Ruby on Rails clone.
- Geddyis another take on web frameworks.
- RailwayJSis a Ruby on Rails inspired MVC web framework.
- Sleek.jsis a simple web framework, built upon Express.js.
- Hapiis a configuration-centric framework with built-in support for input validation, caching, authentication, etc.
Trailsis a modern web application framework. It builds on the pedigree of Railsand Grailsto accelerate development by adhering to a straightforward, convention-based, API-driven design philosophy.
Danfis a full-stack OOP framework providing many features in order to produce a scalable, maintainable, testable and performant applications and allowing to code the same way on both the server (Node.js) and client (browser) sides.
Derbyjsis a reactive full-stack JavaScript framework. They are using patterns like reactive programming and isomorphic JavaScript for a long time.
Loopback.iois a powerful Node.js framework for creating APIs and easily connecting to backend data sources. It has an Angular.js SDK and provides SDKs for iOS and Android.
- Express.js是迄今为止最流行的框架。
- Koa是由 Express.js 背后的团队设计的新 Web 框架,旨在为 Web 应用程序和 API 提供更小、更具表现力和更健壮的基础。
- Sails.js是最流行的 Node.js MVC 框架,基于 express。它旨在模拟熟悉的 Ruby on Rails 等框架的 MVC 模式,但支持现代应用程序的要求:具有可扩展、面向服务的架构的数据驱动 API。
- Meteor将 jQuery、Handlebars、Node.js、WebSocket、MongoDB和 DDP捆绑在一起,并促进约定优于配置,而不是Ruby on Rails克隆。
- Tower(已弃用)是 Express.js 顶层的抽象,旨在成为 Ruby on Rails 克隆。
- Geddy是另一种 Web 框架。
- RailwayJS是一个受 Ruby on Rails 启发的 MVC Web 框架。
- Sleek.js是一个简单的 Web 框架,建立在 Express.js 之上。
- Hapi是一个以配置为中心的框架,内置支持输入验证、缓存、身份验证等。
Trails是一个现代的 Web 应用程序框架。它建立在Rails和Grails的血统之上,通过坚持直接的、基于约定的、API 驱动的设计理念来加速开发。
Danf是一个全栈 OOP 框架,提供了许多特性,以生成可扩展、可维护、可测试和高性能的应用程序,并允许在服务器(Node.js)和客户端(浏览器)端以相同的方式进行编码。
Derbyjs是一个响应式全栈 JavaScript 框架。他们长期使用响应式编程和同构 JavaScript 等模式。
Loopback.io是一个强大的 Node.js 框架,用于创建 API 并轻松连接到后端数据源。它有一个 Angular.js SDK,并提供适用于 iOS 和 Android 的 SDK。
Web Framework Tools:
网络框架工具:
- Jadeis the HAML/Slim of the Node.js world
- EJSis a more traditional templating language.
- Don't forget about Underscore's template method!
- Jade是 Node.js 世界的 HAML/Slim
- EJS是一种更传统的模板语言。
- 不要忘记Underscore 的模板方法!
Networking:
联网:
- Connectis the Rack or WSGI of the Node.js world.
- Requestis a very popular HTTP request library.
- socket.iois handy for building WebSocket servers.
Command Line Interaction:
命令行交互:
- minimistjust command line argument parsing.
- Yargsis a powerful library for parsing command-line arguments.
- Commander.jsis a complete solution for building single-use command-line applications.
- Vorpal.jsis a framework for building mature, immersive command-line applications.
- Chalkmakes your CLI output pretty.
- minimist只是命令行参数解析。
- Yargs是一个强大的库,用于解析命令行参数。
- Commander.js是用于构建一次性命令行应用程序的完整解决方案。
- Vorpal.js是一个用于构建成熟的沉浸式命令行应用程序的框架。
- Chalk使您的 CLI 输出更漂亮。
Work with streams:
使用流:
回答by Zach B
Use the source, Luke.
使用来源,卢克。
No, but seriously I found that building Node.js from source, running the tests, and looking at the benchmarks did get me on the right track. From there, the .js files in the lib directory are a good place to look, especially the file http.js.
不,但说真的,我发现从源代码构建 Node.js、运行测试和查看基准确实让我走上了正确的轨道。从那里,lib 目录中的 .js 文件是一个很好的查看位置,尤其是文件 http.js。
Update: I wrote this answer over a year ago, and since that time there has an explosion in the number of great resources available for people learning Node.js. Though I still believe diving into the source is worthwhile, I think that there are now better ways to get started. I would suggest some of the books on Node.js that are starting to come out.
更新:我在一年前写了这个答案,从那时起,可供学习 Node.js 的人使用的优秀资源数量呈爆炸式增长。尽管我仍然相信深入研究源代码是值得的,但我认为现在有更好的入门方法。我会推荐一些关于 Node.js 的书籍,这些书籍已经开始问世了。

