Skip to content

Commit 4471061

Browse files
author
catchme
committed
勘误
1 parent 6707719 commit 4471061

8 files changed

Lines changed: 7 additions & 10 deletions

File tree

模块/child_process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ child.on('message', function(m){
240240

241241
child.send({from: 'parent'});
242242
```
243-
243+
child.js
244244
```javascript
245245
process.on('message', function(m){
246246
console.log('message from parent: ' + JSON.stringify(m));

模块/dgram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
dgram模块是对UDP socket的一层封装,相对net模块简单很多,下面看例子。
44

5-
## UPD客户端 vs UDP服务端
5+
## UDP客户端 vs UDP服务端
66

77
首先,启动UDP server,监听来自端口33333的请求。
88

模块/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ try{
607607
```javascript
608608
var fs = require('fs');
609609

610-
fs.appendFile('./extra/fileForAppend.txt', 'helo', 'utf8', function(err){
610+
fs.appendFile('./extra/fileForAppend.txt', 'hello', 'utf8', function(err){
611611
if(err) throw err;
612612
console.log('append成功');
613613
});

模块/http.req.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ http.IncomingMessage的属性/方法/事件 不是特别多,按照是否客户
4343
| 属性 | statusCode |||
4444
| 属性 | statusMessage |||
4545
| 属性 | httpVersion |||
46-
| 属性 | httpVersion |||
4746
| 属性 | url |||
4847
| 属性 | socket |||
4948
| 方法 | .destroy() |||
@@ -180,7 +179,7 @@ nick=casper&hello=world
180179
```js
181180
var http = require('http');
182181
var server = http.createServer(function(req, res){
183-
res.writeHead(200, {'content-type': 'text/plain',});
182+
res.writeHead(200, {'content-type': 'text/plain'});
184183
res.end('from server');
185184
});
186185
server.listen(3000);

模块/http.res.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ http模块四剑客之一的`res`,应该都不陌生了。一个web服务程
77
```js
88
var http = require('http');
99
var server = http.createServer(function(req, res){
10-
res.send('ok');
10+
res.end('ok');
1111
});
1212
server.listen(3000);
1313
```

模块/https.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var https = require('https');
2020

2121
https.get('https://www.baidu.com', function(res){
2222
console.log('status code: ' + res.statusCode);
23-
console.log('headers: ' + res.headers);
23+
console.log('headers: ' + JSON.stringify(res.headers));
2424

2525
res.on('data', function(data){
2626
process.stdout.write(data);
@@ -148,7 +148,6 @@ ps:个人认为这里的错误提示有点误导人,12306网站的证书并
148148
```js
149149
// 例子:忽略安全警告
150150
var https = require('https');
151-
var fs = require('fs');
152151

153152
var options = {
154153
hostname: 'kyfw.12306.cn',

模块/path.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ path.parse(path)
174174

175175
```javascript
176176
var path = require('path');
177-
var filepath = '/tmp/demo/js/test.js';
178177

179178
var index = 0;
180179

模块/url.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ url.resolve('http://example.com/one', '/two') // 'http://example.com/two'
182182
183183
## 非法字符转义
184184
185-
url字符是有哥下面的字符会被转义(非法字符)
185+
url字符是有个下面的字符会被转义(非法字符)
186186
187187
> < > " \` \r \n \t { } \| \ ^ '
188188

0 commit comments

Comments
 (0)