# 前言

Node.js 是 JavaScript 后端开发语言。从诞生之初就备受关注，到如今技术已经日臻成熟稳定。正是 Node 的兴起，还带动了前端 JS 的热度，react.js vue.js 这些前端 JS 也火借东风，烧的很旺，甚至连 “全栈” 这个词也一度登上了招聘启事的热搜关键字。本书的写作风格更偏向于底层原理和最佳实践，不会展开评述市面上的所有 Node 编程框架，力求通过一些常用的技术栈来将整个 Node 体系结构串联起来。

**声明**\
nodejs台湾协作电子书（源码参见[github地址](https://github.com/nodejs-tw/nodejs-wiki-book) ），是台湾 nodejs 社区发起的一套nodejs入门教程，本人初学nodejs之时，受其启发颇深。现在台湾社区的兄弟们对其已经停止维护，想想这么优秀的教程就这样白白流逝掉，是一件让人惋惜的事情，于是乎我利用业余时间将其复活。

但是在整理的过程中发现了若干问题，首先繁体中文和简体中文的语言使用上还是有差别，之前耳熟能详的词语到了繁体中文中就变了个叫法，搞的自己差点摸不着头脑；其次，当时书籍写作的时候 Node 的版本还是0.6，如今时过境迁 Node 连10.0都出来了，好多知识点也发生了变化；最后，我也对原书的有些章节安排不是很满意。正是以上三点原因促成了我重写此书的决定。

线上预览地址：<https://nodebook.whyun.com>

本书github地址：<https://github.com/yunnysunny/nodebook>

同时欢迎大家提交pull request来完善文档内容。

**阅读指引**

* 如果你之前有 socket 和多线程的编程经验，可以看第1章，没有上述经验的编程者也可以阅读此章，只不过在阅读过程中可能会遇到概念一时半会儿理解不了。
* 如果之前没有接触过 javascript 这门语言，可以从第2章开始阅读，第2章讲述了一些 javascript 的基础语法。
* 如果之前接触过 javascript ，但是没有接触过 Node.js ，可以从第3章开始阅读，第3章讲述了一些 Node.js 的基础 API。
* 如果之前接触过 Node.js ，但是没有用过数据库操作，可以阅读第5章，第5章讲述了 Node 中操作 redis 、mongodb 的 API 如何使用；如果没有使用 express ，可以阅读第6章和第7章，这两章讲述了如何利用 express 这个 HTTP 编程框架。
* 最后介绍一下一些独立章节，第4章讲述了 npm 命令的使用教程；第8章讲述了如何使用单元测试框架mocha；第9章讲述了一些线上环境的最佳实践，包括配置文件、进程管理、 docker 等内容；第10章讲述如何编写 c++ 扩展。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nodebook.whyun.com/00_preface.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
