@@ -1298,35 +1298,20 @@ changes:
1298
1298
1299
1299
* ` path ` {string|Buffer|URL}
1300
1300
* ` options ` {string|Object}
1301
- * ` flags ` {string}
1302
- * ` encoding ` {string}
1303
- * ` fd ` {integer}
1304
- * ` mode ` {integer}
1305
- * ` autoClose ` {boolean}
1301
+ * ` flags ` {string} ** Default: ** ` 'r' `
1302
+ * ` encoding ` {string} ** Default: ** ` null `
1303
+ * ` fd ` {integer} ** Default: ** ` null `
1304
+ * ` mode ` {integer} ** Default: ** ` 0o666 `
1305
+ * ` autoClose ` {boolean} ** Default: ** ` true `
1306
1306
* ` start ` {integer}
1307
- * ` end ` {integer}
1308
- * ` highWaterMark ` {integer}
1309
- * Returns: {stream.Readable}
1310
-
1311
- Returns a new [ ` ReadStream ` ] [ ] object. (See [ Readable Streams] [ ] ).
1307
+ * ` end ` {integer} ** Default:** ` Infinity `
1308
+ * ` highWaterMark ` {integer} ** Default:** ` 64 * 1024 `
1309
+ * Returns: {fs.ReadStream} See [ Readable Streams] [ ] .
1312
1310
1313
1311
Be aware that, unlike the default value set for ` highWaterMark ` on a
1314
1312
readable stream (16 kb), the stream returned by this method has a
1315
1313
default value of 64 kb for the same parameter.
1316
1314
1317
- ` options ` is an object or string with the following defaults:
1318
-
1319
- ``` js
1320
- const defaults = {
1321
- flags: ' r' ,
1322
- encoding: null ,
1323
- fd: null ,
1324
- mode: 0o666 ,
1325
- autoClose: true ,
1326
- highWaterMark: 64 * 1024
1327
- };
1328
- ```
1329
-
1330
1315
` options ` can include ` start ` and ` end ` values to read a range of bytes from
1331
1316
the file instead of the entire file. Both ` start ` and ` end ` are inclusive and
1332
1317
start counting at 0. If ` fd ` is specified and ` start ` is omitted or ` undefined ` ,
@@ -1376,27 +1361,13 @@ changes:
1376
1361
1377
1362
* ` path ` {string|Buffer|URL}
1378
1363
* ` options ` {string|Object}
1379
- * ` flags ` {string}
1380
- * ` encoding ` {string}
1381
- * ` fd ` {integer}
1382
- * ` mode ` {integer}
1383
- * ` autoClose ` {boolean}
1364
+ * ` flags ` {string} ** Default: ** ` 'w' `
1365
+ * ` encoding ` {string} ** Default: ** ` 'utf8' `
1366
+ * ` fd ` {integer} ** Default: ** ` null `
1367
+ * ` mode ` {integer} ** Default: ** ` 0o666 `
1368
+ * ` autoClose ` {boolean} ** Default: ** ` true `
1384
1369
* ` start ` {integer}
1385
- * Returns: {stream.Writable}
1386
-
1387
- Returns a new [ ` WriteStream ` ] [ ] object. (See [ Writable Stream] [ ] ).
1388
-
1389
- ` options ` is an object or string with the following defaults:
1390
-
1391
- ``` js
1392
- const defaults = {
1393
- flags: ' w' ,
1394
- encoding: ' utf8' ,
1395
- fd: null ,
1396
- mode: 0o666 ,
1397
- autoClose: true
1398
- };
1399
- ```
1370
+ * Returns: {fs.WriteStream} See [ Writable Stream] [ ] .
1400
1371
1401
1372
` options ` may also include a ` start ` option to allow writing data at
1402
1373
some position past the beginning of the file. Modifying a file rather
@@ -1410,7 +1381,7 @@ then the file descriptor won't be closed, even if there's an error.
1410
1381
It is the application's responsibility to close it and make sure there's no
1411
1382
file descriptor leak.
1412
1383
1413
- Like [ ` ReadStream ` ] [ ] , if ` fd ` is specified, ` WriteStream ` will ignore the
1384
+ Like [ ` ReadStream ` ] [ ] , if ` fd ` is specified, [ ` WriteStream ` ] [ ] will ignore the
1414
1385
` path ` argument and will use the specified file descriptor. This means that no
1415
1386
` 'open' ` event will be emitted. Note that ` fd ` should be blocking; non-blocking
1416
1387
` fd ` s should be passed to [ ` net.Socket ` ] [ ] .
@@ -1675,7 +1646,7 @@ added: v0.1.95
1675
1646
* ` fd ` {integer}
1676
1647
* Returns: {fs.Stats}
1677
1648
1678
- Synchronous fstat(2). Returns an instance of [ ` fs.Stats ` ] [ ] .
1649
+ Synchronous fstat(2).
1679
1650
1680
1651
## fs.fsync(fd, callback)
1681
1652
<!-- YAML
@@ -1978,7 +1949,7 @@ changes:
1978
1949
* ` path ` {string|Buffer|URL}
1979
1950
* Returns: {fs.Stats}
1980
1951
1981
- Synchronous lstat(2). Returns an instance of [ ` fs.Stats ` ] [ ] .
1952
+ Synchronous lstat(2).
1982
1953
1983
1954
## fs.mkdir(path[ , mode] , callback)
1984
1955
<!-- YAML
@@ -2339,10 +2310,9 @@ changes:
2339
2310
* ` path ` {string|Buffer|URL}
2340
2311
* ` options ` {string|Object}
2341
2312
* ` encoding ` {string} ** Default:** ` 'utf8' `
2342
- * Returns: {string[ ] } An array of filenames
2313
+ * Returns: {string[ ] } An array of filenames excluding ` '.' ` and ` '..' ` .
2343
2314
2344
- Synchronous readdir(3). Returns an array of filenames excluding ` '.' ` and
2345
- ` '..' ` .
2315
+ Synchronous readdir(3).
2346
2316
2347
2317
The optional ` options ` argument can be a string specifying an encoding, or an
2348
2318
object with an ` encoding ` property specifying the character encoding to use for
@@ -2841,7 +2811,7 @@ changes:
2841
2811
* ` path ` {string|Buffer|URL}
2842
2812
* Returns: {fs.Stats}
2843
2813
2844
- Synchronous stat(2). Returns an instance of [ ` fs.Stats ` ] [ ] .
2814
+ Synchronous stat(2).
2845
2815
2846
2816
## fs.symlink(target, path[ , type] , callback)
2847
2817
<!-- YAML
@@ -3094,9 +3064,10 @@ changes:
3094
3064
* ` listener ` {Function|undefined} ** Default:** ` undefined `
3095
3065
* ` eventType ` {string}
3096
3066
* ` filename ` {string|Buffer}
3067
+ * Returns: {fs.FSWatcher}
3097
3068
3098
3069
Watch for changes on ` filename ` , where ` filename ` is either a file or a
3099
- directory. The returned object is a [ ` fs.FSWatcher ` ] [ ] .
3070
+ directory.
3100
3071
3101
3072
The second argument is optional. If ` options ` is provided as a string, it
3102
3073
specifies the ` encoding ` . Otherwise ` options ` should be passed as an object.
0 commit comments