@@ -1612,6 +1612,9 @@ If `position` is `null`, data will be read from the current file position.
16121612
16131613The callback is given the three arguments, ` (err, bytesRead, buffer) ` .
16141614
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+
16151618## fs.readdir(path[ , options] , callback)
16161619<!-- YAML
16171620added: v0.1.8
@@ -2393,8 +2396,11 @@ an integer specifying the number of bytes to write.
23932396should be written. If ` typeof position !== 'number' ` , the data will be written
23942397at the current position. See pwrite(2).
23952398
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.
23982404
23992405Note that it is unsafe to use ` fs.write ` multiple times on the same file
24002406without waiting for the callback. For this scenario,
@@ -2810,6 +2816,7 @@ The following constants are meant for use with the [`fs.Stats`][] object's
28102816[ `net.Socket` ] : net.html#net_class_net_socket
28112817[ `stat()` ] : fs.html#fs_fs_stat_path_callback
28122818[ `util.inspect(stats)` ] : util.html#util_util_inspect_object_options
2819+ [ `util.promisify()` ] : util.html#util_util_promisify_original
28132820[ Caveats ] : #fs_caveats
28142821[ Common System Errors ] : errors.html#errors_common_system_errors
28152822[ FS Constants ] : #fs_fs_constants_1
0 commit comments