Skip to content

Commit bce092a

Browse files
committed
Remove leading comma examples
1 parent 57de0b1 commit bce092a

6 files changed

Lines changed: 47 additions & 61 deletions

File tree

TODO

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
EventEmitter.optHandlers.encoding() if it exists.
2626

2727
- DOCS
28-
- Fix examples using leading comma style. EG
29-
http://nodejs.org/docs/v0.3.1/api/fs.html#fs.stat
3028
- anchor links next to each function, for easy linking.
3129
EG <a href="#fs.stat">#</a>
3230

doc/api/child_processes.markdown

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ If omitted, `args` defaults to an empty Array.
5757

5858
The third argument is used to specify additional options, which defaults to:
5959

60-
{ cwd: undefined
61-
, env: process.env,
62-
, customFds: [-1, -1, -1]
63-
}
60+
{ cwd: undefined,
61+
env: process.env,
62+
customFds: [-1, -1, -1] }
6463

6564
`cwd` allows you to specify the working directory from which the process is spawned.
6665
Use `env` to specify environment variables that will be visible to the new process.
@@ -162,13 +161,12 @@ signal that terminated the process.
162161

163162
There is a second optional argument to specify several options. The default options are
164163

165-
{ encoding: 'utf8'
166-
, timeout: 0
167-
, maxBuffer: 200*1024
168-
, killSignal: 'SIGTERM'
169-
, cwd: null
170-
, env: null
171-
}
164+
{ encoding: 'utf8',
165+
timeout: 0,
166+
maxBuffer: 200*1024,
167+
killSignal: 'SIGTERM',
168+
cwd: null,
169+
env: null }
172170

173171
If `timeout` is greater than 0, then it will kill the child process
174172
if it runs longer than `timeout` milliseconds. The child process is killed with

doc/api/fs.markdown

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,19 @@ Synchronous chmod(2).
8484
Asynchronous stat(2). The callback gets two arguments `(err, stats)` where
8585
`stats` is a `fs.Stats` object. It looks like this:
8686

87-
{ dev: 2049
88-
, ino: 305352
89-
, mode: 16877
90-
, nlink: 12
91-
, uid: 1000
92-
, gid: 1000
93-
, rdev: 0
94-
, size: 4096
95-
, blksize: 4096
96-
, blocks: 8
97-
, atime: '2009-06-29T11:11:55Z'
98-
, mtime: '2009-06-29T11:11:40Z'
99-
, ctime: '2009-06-29T11:11:40Z'
100-
}
87+
{ dev: 2049,
88+
ino: 305352,
89+
mode: 16877,
90+
nlink: 12,
91+
uid: 1000,
92+
gid: 1000,
93+
rdev: 0,
94+
size: 4096,
95+
blksize: 4096,
96+
blocks: 8,
97+
atime: '2009-06-29T11:11:55Z',
98+
mtime: '2009-06-29T11:11:40Z',
99+
ctime: '2009-06-29T11:11:40Z' }
101100

102101
See the `fs.Stats` section below for more information.
103102

@@ -350,11 +349,10 @@ Returns a new ReadStream object (See `Readable Stream`).
350349

351350
`options` is an object with the following defaults:
352351

353-
{ 'flags': 'r'
354-
, 'encoding': null
355-
, 'mode': 0666
356-
, 'bufferSize': 4 * 1024
357-
}
352+
{ flags: 'r',
353+
encoding: null,
354+
mode: 0666,
355+
bufferSize: 4096 }
358356

359357
`options` can include `start` and `end` values to read a range of bytes from
360358
the file instead of the entire file. Both `start` and `end` are inclusive and
@@ -381,7 +379,6 @@ Returns a new WriteStream object (See `Writable Stream`).
381379

382380
`options` is an object with the following defaults:
383381

384-
{ 'flags': 'w'
385-
, 'encoding': null
386-
, 'mode': 0666
387-
}
382+
{ flags: 'w',
383+
encoding: null,
384+
mode: 0666 }

doc/api/http.markdown

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ user is able to stream data.
1010

1111
HTTP message headers are represented by an object like this:
1212

13-
{ 'content-length': '123'
14-
, 'content-type': 'text/plain'
15-
, 'connection': 'keep-alive'
16-
, 'accept': '*/*'
17-
}
13+
{ 'content-length': '123',
14+
'content-type': 'text/plain',
15+
'connection': 'keep-alive',
16+
'accept': '*/*' }
1817

1918
Keys are lowercased. Values are not modified.
2019

@@ -182,22 +181,20 @@ If you would like to parse the URL into its parts, you can use
182181
`require('url').parse(request.url)`. Example:
183182

184183
node> require('url').parse('/status?name=ryan')
185-
{ href: '/status?name=ryan'
186-
, search: '?name=ryan'
187-
, query: 'name=ryan'
188-
, pathname: '/status'
189-
}
184+
{ href: '/status?name=ryan',
185+
search: '?name=ryan',
186+
query: 'name=ryan',
187+
pathname: '/status' }
190188

191189
If you would like to extract the params from the query string,
192190
you can use the `require('querystring').parse` function, or pass
193191
`true` as the second argument to `require('url').parse`. Example:
194192

195193
node> require('url').parse('/status?name=ryan', true)
196-
{ href: '/status?name=ryan'
197-
, search: '?name=ryan'
198-
, query: { name: 'ryan' }
199-
, pathname: '/status'
200-
}
194+
{ href: '/status?name=ryan',
195+
search: '?name=ryan',
196+
query: { name: 'ryan' },
197+
pathname: '/status' }
201198

202199

203200

@@ -266,8 +263,7 @@ Example:
266263
var body = 'hello world';
267264
response.writeHead(200, {
268265
'Content-Length': body.length,
269-
'Content-Type': 'text/plain'
270-
});
266+
'Content-Type': 'text/plain' });
271267

272268
This method must only be called once on a message and it must
273269
be called before `response.end()` is called.

doc/api/process.markdown

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,10 @@ Returns an object describing the memory usage of the Node process.
276276

277277
This will generate:
278278

279-
{ rss: 4935680
280-
, vsize: 41893888
281-
, heapTotal: 1826816
282-
, heapUsed: 650472
283-
}
279+
{ rss: 4935680,
280+
vsize: 41893888,
281+
heapTotal: 1826816,
282+
heapUsed: 650472 }
284283

285284
`heapTotal` and `heapUsed` refer to V8's memory usage.
286285

doc/api/querystring.markdown

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ Example:
2424

2525
querystring.parse('a=b&b=c')
2626
// returns
27-
{ 'a': 'b'
28-
, 'b': 'c'
29-
}
27+
{ a: 'b', b: 'c' }
3028

3129
### querystring.escape
3230

0 commit comments

Comments
 (0)