The Definitive Guide to Node.js cover

The Definitive Guide to Node.js

Rating 3.1
Chapters
17
ISBN
9787111460787

Tags

Summary

This is a technical monograph on Node.js written by Lu Lingniu and published by China Machine Press in April 2014. It has 16 chapters in three parts and, set against the CommonJS specification, systematically explains Node.js's runtime mechanisms and server-side development methods. Part One (Chapters 1–12) covers the basics: starting from Node.js's features, advantages, use cases, and installation and configuration, it goes chapter by chapter through the REPL interactive environment; the console and global objects; the module mechanism and npm package management; Buffer for binary data; file system operations; TCP- and UDP-based data communication; creating HTTP and HTTPS servers and clients; processes and child processes; error handling and assertions; and encryption and compression, while explaining such principles as event-driven programming, non-blocking I/O, and the event loop. Part Two (Chapters 13–15) covers extensions: common third-party packages, accessing relational databases such as MySQL and NoSQL databases such as MongoDB from Node.js applications, building web applications with the Express framework, and implementing WebSocket real-time communication with the Socket.IO library. Part Three (Chapter 16) is hands-on: two comprehensive cases tie the book together—a chat room server and client built with Socket.IO, and a complete web application server and client built with Express. Every topic comes with a runnable mini-case, and the code has been debugged, emphasizing a practical approach to mastering Node.js development.

Editor's review

如果把 Node.js 当作一门需要“系统学一遍”的技术,这本书的定位相当清晰:先打地基,再扩边界,最后用两个完整案例把知识串起来。基础篇的十二章几乎把 Node.js 自带的核心模块过了一遍——从 REPL、控制台、模块与 npm,到 Buffer、文件系统、TCP/UDP、HTTP/HTTPS、进程与子进程,再到错误处理、加密压缩,读者可以据此建立一份相对完整的“Node 内置能力地图”,而不是只会写几个路由。扩展篇则把真实项目绕不开的三件事讲了:数据库访问、Express 建站、Socket.IO 做实时通信,正好对应当时 Web 应用最常见的组合。实战篇的聊天室与 Web 应用案例,把服务端和客户端一起写出来,对缺乏后端经验的读者尤其有价值。需要注意,本书成书于 2014 年,代码基于当时的 Node.js 版本与回调风格,部分 API 与工程实践(如 Promise/async、新版 Express 与包管理生态)已经变化,读者更适合把它当作理解 Node.js 核心机制与模块体系的参考书,边读边在新版本环境中改写示例代码,收获会比照抄更大。

Who it's for

A good fit for

  • 已掌握 JavaScript 基础语法、想系统学习 Node.js 的开发者
  • 从前端转向服务端、需要补齐后端知识的前端工程师
  • 想了解 Node.js 核心模块、事件驱动与非阻塞 I/O 原理的自学者
  • 需要一本可当模块用法参考手册常备在手的工程师

Not a good fit for

  • 完全没有编程基础、只想要“一周速成”的零基础读者
  • 只关心 TypeScript、现代前端框架与云原生部署的读者
  • 希望直接学习最新 Node.js 版本与 async/await 写法的读者

Reading tips

  1. 按第1~12章顺序阅读,边读边在本地环境动手敲示例代码,不要只看不练。
  2. 本书代码基于 2014 年前后的 Node.js 版本,建议先安装对应旧版本跑通示例,再尝试改用新版 API 重写。
  3. 把第4章模块与 npm、第8章 HTTP/HTTPS 作为重点精读,这两块是后续所有框架的地基。
  4. 读完第14、15章后先自己复现聊天室案例,再进入第16章的综合案例,效果更好。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Preface
  2. Chapter 1 Introduction to Node.js
  3. Chapter 2 The Interactive Runtime Environment in Node.js—REPL
  4. Chapter 3 Node.js Basics
  5. Chapter 4 Modules and the npm Package Management Tool
  6. Chapter 5 Handling Binary Data with the Buffer Class
  7. Chapter 6 Operating the File System in Node.js
  8. Chapter 7 Implementing TCP- and UDP-Based Data Communication
  9. Chapter 8 Creating HTTP and HTTPS Servers and Clients
  10. Chapter 9 Processes and Child Processes
  11. Chapter 10 Error Handling and Assertion Handling in Node.js
  12. Chapter 11 Encryption and Compression
  13. Chapter 12 Other Modules in Node.js
  14. Chapter 13 Database Access
  15. Chapter 14 Building Web Applications with Express
  16. Chapter 15 Implementing WebSocket Communication with the Socket.IO Library
  17. Chapter 16 Comprehensive Case Studies

FAQ

这本书适合零基础入门 Node.js 吗?
不太适合完全零基础。书中默认读者已掌握 JavaScript 基本语法,直接从 Node.js 的模块机制和非阻塞 I/O 讲起,没有详细铺陈语法基础。有 JS 基础再读会顺畅很多。
这本书的内容现在过时了吗?
书出版于 2014 年 4 月,示例基于当时的 Node.js 版本,采用回调风格,Express、Socket.IO 也是旧版 API。核心模块机制与事件驱动原理仍然成立,但语法和工程实践已变化,建议把它当原理参考书,示例在新版本环境中重写。
书里的案例可以直接运行吗?
按作者说明,书中所有实例代码都经调试运行成功。但由于 Node.js 版本和第三方包版本不断升级,直接复制可能报错,通常需要安装对应旧版本依赖或做少量修改。
这本书和《深入浅出Node.js》有什么区别?
《深入浅出Node.js》更偏底层原理剖析,讨论事件循环、内存、异步实现等机制;本书覆盖面更广,按模块逐项讲用法,并用 Express 与 Socket.IO 做完整案例,更像一本系统化的教程加参考手册,两者可以互补阅读。

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.

More by the same author

Top rated in the same category