Node.js in Action, Second Edition cover

Node.js in Action, Second Edition

Rating 3.7
Word count
485K words
Chapters
19
Series
Turing Programming Series
ISBN
9787115487308

Tags

Summary

This book is the Chinese translation of the second edition of Node.js in Action, part of the Turing Programming Series, written jointly by several contributors to Node.js core frameworks and active community developers. The book is built around a single main thread—"building production-grade applications on the server side with JavaScript"—and is divided into three parts. Part One lays the foundation: it explains Node's non-blocking I/O and event-loop model, the relationship between Node and V8 and ES2015 versions, installation and the bundled npm, core modules, and the debugger, as well as the three main forms of Node programs—web applications, command-line tools and background daemons, and desktop applications; it then covers module organization and getting a project started, and HTTP services and the middleware-style structure of web applications. Part Two moves into hands-on web development: front-end build systems, comparison and selection of server-side frameworks, in-depth use of Connect and Express, server-side templates such as EJS, Mustache, and Jade, integration of databases and storage solutions, testing Node programs (including unit tests and functional tests), and deployment and operations (PaaS, servers, containers, Git deployment, saturating multiple cores with the cluster API, static files, and reverse proxies). Part Three goes beyond the web: writing and publishing command-line tools and pipeline scripts, and building cross-platform desktop applications with Electron. The appendices also provide guidance on installing Node, automated web scraping, and a quick reference to Connect's official middleware.

Editor's review

很多 Node.js 入门书只讲到「跑起一个 Hello World」,而这本书回答的是另一个问题:怎样把一个 Node 应用真正交付上线。作者团队里有 Express 框架的参与者,也有 Node 核心代码的提交者,因此书中对事件轮询、异步流程、中间件机制这些「面试常问、编码常坑」的地方讲得比较扎实,而不是停留在 API 罗列。第二版的最大价值在于覆盖面被拉到了全栈:从 Babel/Webpack 一类前端构建,到数据库选型、测试分层、用集群 API 与反向代理把服务撑住,再到命令行工具和 Electron 桌面程序,读者能在一个项目里看到完整链路。翻译由吴海星完成,术语沿用社区通行译法,代码示例基本可以直接照抄运行。需要注意,书中示例环境基于 2018 年前后的 Node 版本与工具链,个别依赖包如今已大改版,阅读时请对照官方文档。整体适合当作「从会写 JavaScript 到能交付 Node 服务」的桥梁书。

Who it's for

A good fit for

  • 已掌握 JavaScript 基础语法,想转向服务端开发的读者
  • 有 PHP、Java 或 Python 后台经验、准备尝试 Node 的工程师
  • 需要独立完成从开发到部署全流程的中小团队开发者
  • 计算机相关专业学生,想做一个可上线的毕业设计或课程项目
  • 对 Express、Electron、命令行工具都感兴趣的全栈学习者

Not a good fit for

  • 完全没有编程经验、连函数和回调都还没写熟的零基础读者
  • 想深入钻研 V8 内存管理、libuv 源码或 Node 内核实现的研究者
  • 只想速查 API 手册、不需要系统学习路径的读者
  • 只做浏览器端页面样式与交互、不涉及服务端的前端初学者

Reading tips

  1. 先读完第一部分三章再动手写代码,理解事件轮询后才不会把异步代码写出同步思维。
  2. 边读边在一个真实小项目里跑通示例,第二部分的构建、模板、存储、测试、部署最好串成一条线做完。
  3. 书中依赖版本较旧,遇到报错先去查当前版本的官方文档和 npm 页面,把排错当作练习的一部分。
  4. 第三部分的命令行工具和 Electron 章节可以按兴趣选读,读完再回头补附录的抓取与中间件速查。
  5. 配合《深入浅出Node.js》一起读:本书偏「怎么做」,后者补足「为什么这样设计」的原理层。

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. Part One: Introduction to Node Basics
  2. Chapter 1: Welcome to the World of Node.js
  3. Chapter 2: Node Programming Basics
  4. Chapter 3: What Is a Node Web Application
  5. Part Two: Web Development with Node
  6. Chapter 4: Front-End Build Systems
  7. Chapter 5: Server-Side Frameworks
  8. Chapter 6: In-Depth Connect and Express
  9. Chapter 7: Templates for Web Applications
  10. Chapter 8: Storing Data
  11. Chapter 9: Testing Node Programs
  12. Chapter 10: Deployment and Operations of Node Programs
  13. Part Three: Beyond Web Development
  14. Chapter 11: Writing Command-Line Programs
  15. Chapter 12: Conquering the Desktop with Electron
  16. Appendix A: Installing Node
  17. Appendix B: Automated Web Scraping
  18. Appendix C: Connect's Official Middleware
  19. Glossary

FAQ

这本书适合零基础学 Node.js 吗?
不太适合。书中默认读者会写 JavaScript,能理解回调与模块概念;如果连异步、闭包都还没掌握,建议先用《JavaScript 高级程序设计》一类书补齐语言基础,再回来读本书第一部分。
第1版和第2版差别大吗?
差别不小。第2版按《Node.js in Action》第二版重译,新增了前端构建系统、容器化部署、编写命令行程序和用 Electron 做桌面应用等内容,并对模板、测试和框架讲解做了大幅改写,旧版读者也值得再买新版。
书里的代码现在还能运行吗?
核心概念和大部分示例逻辑仍然有效,但书中示例环境基于 2018 年前后的 Node 版本,Express、Webpack、Babel 等依赖已经历多轮大版本更新,个别配置写法会报错,建议对照官方文档调整。
这本书和《深入浅出Node.js》有什么区别?
朴灵的《深入浅出Node.js》偏重原理,讲事件循环、内存、异步 I/O 的底层实现;本书偏重工程实践,带读者把一个 Web 应用从搭建、开发、测试一路做到部署上线,两者互补。
没有后台经验,直接读这本书可以吗?
可以尝试。书中对 HTTP 服务、中间件、数据库访问都是从零讲起,但如果完全没接触过服务端概念,建议先补一点 HTTP 协议与关系型数据库基础,阅读体验会顺很多。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

Top rated in the same category