第二部分 API 和常用模块
第
4
章 核心
API
..............................................................................................................................
55
4.1 Events
........................................................................................................................................
55
4.1.1
EventEmitter
...........................................................................................................
56
4.1.2 Callback 语法
...............................................................................................................
57
4.2 HTTP
.........................................................................................................................................
59
4.2.1 HTTP 服务器
............................................................................................
...................
59
4.2.2 HTTP 客户端
...............................................................................................................
61
4.2.3 URL
..............................................................................................................................
65
4.2.4 querystring
................................................................................................
....................
67
4.3 I/O
..............................................................................................................................................
68
4.3.1 数据流(stream)
..........................................................................................................
68
4.3.2 文件系统
..........................................................................................
............................
69
4.3.3 Buffer
............................................................................................................................
70
4.3.4 console.log
....................................................................................................................
76
第
5
章 工具类
API
..........................................................................................................................
77
5.1 DNS
...........................................................................................................................................
77
5.2 加密
...........................................................................................................................................
79
5.2.1 Hashing
.................................................
........................................................................
7
9
5.2.2 HMAC
..........................................................................................................................
81
5.2.3 公钥加密
......................................................................................................................
82
5.3 进程
.....................................................
......................................................................................
86
5.3.1
process
模块
.............................................................................................................
87
5.3.2 子进程
..........................................................................................................................
95
5.4 用 assert 来测试
......................................................................................................................
1
01
5.5 虚拟机
.....................................................................................................................................
104
第
6
章 数据访问
............................................................................................................................
109
6.1 NoSQL 和文档存储
...............................................................................................................
1
09
6.1.1 CouchDB
....................................................................................................................
109
6.1.2 Redis
...........................................................................................................................
117
6.1.3 MongoDB
.....................
..............................................................................................
125
6.2 关系型数据库
.........................................................................................................................
129
6.2.1 MySQL
.......................................................................................................................
129
6.2.2 PostgreSQL
.................
................................................................................................
136