@@ -1612,6 +1612,9 @@ If `position` is `null`, data will be read from the current file position.
1612
1612
1613
1613
The callback is given the three arguments, ` (err, bytesRead, buffer) ` .
1614
1614
1615
+ If this method is invoked as its [ ` util.promisify() ` ] [ ] ed version, it returns
1616
+ a Promise for an object with ` bytesRead ` and ` buffer ` properties.
1617
+
1615
1618
## fs.readdir(path[ , options] , callback)
1616
1619
<!-- YAML
1617
1620
added: v0.1.8
@@ -2393,8 +2396,11 @@ an integer specifying the number of bytes to write.
2393
2396
should be written. If ` typeof position !== 'number' ` , the data will be written
2394
2397
at the current position. See pwrite(2).
2395
2398
2396
- The callback will be given three arguments ` (err, written, buffer) ` where
2397
- ` written ` specifies how many _ bytes_ were written from ` buffer ` .
2399
+ The callback will be given three arguments ` (err, bytesWritten, buffer) ` where
2400
+ ` bytesWritten ` specifies how many _ bytes_ were written from ` buffer ` .
2401
+
2402
+ If this method is invoked as its [ ` util.promisify() ` ] [ ] ed version, it returns
2403
+ a Promise for an object with ` bytesWritten ` and ` buffer ` properties.
2398
2404
2399
2405
Note that it is unsafe to use ` fs.write ` multiple times on the same file
2400
2406
without waiting for the callback. For this scenario,
@@ -2810,6 +2816,7 @@ The following constants are meant for use with the [`fs.Stats`][] object's
2810
2816
[ `net.Socket` ] : net.html#net_class_net_socket
2811
2817
[ `stat()` ] : fs.html#fs_fs_stat_path_callback
2812
2818
[ `util.inspect(stats)` ] : util.html#util_util_inspect_object_options
2819
+ [ `util.promisify()` ] : util.html#util_util_promisify_original
2813
2820
[ Caveats ] : #fs_caveats
2814
2821
[ Common System Errors ] : errors.html#errors_common_system_errors
2815
2822
[ FS Constants ] : #fs_fs_constants_1
0 commit comments