Skip to content

Commit e42600f

Browse files
Sho MiyamotoMylesBorins
Sho Miyamoto
authored andcommitted
doc: add missing Returns in fs & util
Backport-PR-URL: #19127 PR-URL: #18775 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 4ecf5bb commit e42600f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

doc/api/fs.md

+16
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,7 @@ changes:
11981198
* `start` {integer}
11991199
* `end` {integer}
12001200
* `highWaterMark` {integer}
1201+
* Returns: {ReadStream}
12011202

12021203
Returns a new [`ReadStream`][] object. (See [Readable Streams][]).
12031204

@@ -1273,6 +1274,7 @@ changes:
12731274
* `mode` {integer}
12741275
* `autoClose` {boolean}
12751276
* `start` {integer}
1277+
* Returns: {WriteStream}
12761278

12771279
Returns a new [`WriteStream`][] object. (See [Writable Stream][]).
12781280

@@ -1428,6 +1430,7 @@ changes:
14281430
-->
14291431

14301432
* `path` {string|Buffer|URL}
1433+
* Returns: {boolean}
14311434

14321435
Synchronous version of [`fs.exists()`][].
14331436
Returns `true` if the path exists, `false` otherwise.
@@ -1546,6 +1549,7 @@ added: v0.1.95
15461549
-->
15471550

15481551
* `fd` {integer}
1552+
* Returns: {fs.Stats}
15491553

15501554
Synchronous fstat(2). Returns an instance of [`fs.Stats`][].
15511555

@@ -1820,6 +1824,7 @@ changes:
18201824
-->
18211825

18221826
* `path` {string|Buffer|URL}
1827+
* Returns: {fs.Stats}
18231828

18241829
Synchronous lstat(2). Returns an instance of [`fs.Stats`][].
18251830

@@ -1945,6 +1950,7 @@ added: v5.10.0
19451950
* `prefix` {string}
19461951
* `options` {string|Object}
19471952
* `encoding` {string} **Default:** `'utf8'`
1953+
* Returns: {string}
19481954

19491955
The synchronous version of [`fs.mkdtemp()`][]. Returns the created
19501956
folder path.
@@ -2069,6 +2075,7 @@ changes:
20692075
* `path` {string|Buffer|URL}
20702076
* `flags` {string|number}
20712077
* `mode` {integer} **Default:** `0o666`
2078+
* Returns: {number}
20722079

20732080
Synchronous version of [`fs.open()`][]. Returns an integer representing the file
20742081
descriptor.
@@ -2159,6 +2166,7 @@ changes:
21592166
* `path` {string|Buffer|URL}
21602167
* `options` {string|Object}
21612168
* `encoding` {string} **Default:** `'utf8'`
2169+
* Returns: {Array} An array of filenames
21622170

21632171
Synchronous readdir(3). Returns an array of filenames excluding `'.'` and
21642172
`'..'`.
@@ -2260,6 +2268,7 @@ changes:
22602268
* `options` {Object|string}
22612269
* `encoding` {string|null} **Default:** `null`
22622270
* `flag` {string} **Default:** `'r'`
2271+
* Returns: {string|Buffer}
22632272

22642273
Synchronous version of [`fs.readFile()`][]. Returns the contents of the `path`.
22652274

@@ -2320,6 +2329,7 @@ changes:
23202329
* `path` {string|Buffer|URL}
23212330
* `options` {string|Object}
23222331
* `encoding` {string} **Default:** `'utf8'`
2332+
* Returns: {string|Buffer}
23232333

23242334
Synchronous readlink(2). Returns the symbolic link's string value.
23252335

@@ -2342,6 +2352,7 @@ changes:
23422352
* `offset` {integer}
23432353
* `length` {integer}
23442354
* `position` {integer}
2355+
* Returns: {number}
23452356

23462357
Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`.
23472358

@@ -2452,6 +2463,7 @@ changes:
24522463
* `path` {string|Buffer|URL}
24532464
* `options` {string|Object}
24542465
* `encoding` {string} **Default:** `'utf8'`
2466+
* Returns: {string|Buffer}
24552467

24562468
Synchronously computes the canonical pathname by resolving `.`, `..` and
24572469
symbolic links.
@@ -2482,6 +2494,7 @@ added: v9.2.0
24822494
* `path` {string|Buffer|URL}
24832495
* `options` {string|Object}
24842496
* `encoding` {string} **Default:** `'utf8'`
2497+
* Returns: {string|Buffer}
24852498

24862499
Synchronous realpath(3).
24872500

@@ -2619,6 +2632,7 @@ changes:
26192632
-->
26202633

26212634
* `path` {string|Buffer|URL}
2635+
* Returns: {fs.Stats}
26222636

26232637
Synchronous stat(2). Returns an instance of [`fs.Stats`][].
26242638

@@ -3197,6 +3211,7 @@ changes:
31973211
* `offset` {integer}
31983212
* `length` {integer}
31993213
* `position` {integer}
3214+
* Returns: {number}
32003215

32013216
## fs.writeSync(fd, string[, position[, encoding]])
32023217
<!-- YAML
@@ -3211,6 +3226,7 @@ changes:
32113226
* `string` {string}
32123227
* `position` {integer}
32133228
* `encoding` {string}
3229+
* Returns: {number}
32143230

32153231
Synchronous versions of [`fs.write()`][]. Returns the number of bytes written.
32163232

doc/api/util.md

+16
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ contains circular references.
190190
Similar to `util.inspect()` without options.
191191
This will show the full object not including non-enumerable symbols and properties.
192192
* `%%` - single percent sign (`'%'`). This does not consume an argument.
193+
* Returns: {string} The formatted string
193194

194195
If the placeholder does not have a corresponding argument, the placeholder is
195196
not replaced.
@@ -806,6 +807,7 @@ deprecated: v4.0.0
806807
> Stability: 0 - Deprecated
807808
808809
* `object` {any}
810+
* Returns: {boolean}
809811

810812
Internal alias for [`Array.isArray`][].
811813

@@ -831,6 +833,7 @@ deprecated: v4.0.0
831833
> Stability: 0 - Deprecated
832834
833835
* `object` {any}
836+
* Returns: {boolean}
834837

835838
Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
836839

@@ -854,6 +857,7 @@ deprecated: v4.0.0
854857
> Stability: 0 - Deprecated: Use [`Buffer.isBuffer()`][] instead.
855858
856859
* `object` {any}
860+
* Returns: {boolean}
857861

858862
Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`.
859863

@@ -877,6 +881,7 @@ deprecated: v4.0.0
877881
> Stability: 0 - Deprecated
878882
879883
* `object` {any}
884+
* Returns: {boolean}
880885

881886
Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`.
882887

@@ -900,6 +905,7 @@ deprecated: v4.0.0
900905
> Stability: 0 - Deprecated
901906
902907
* `object` {any}
908+
* Returns: {boolean}
903909

904910
Returns `true` if the given `object` is an [`Error`][]. Otherwise, returns
905911
`false`.
@@ -939,6 +945,7 @@ deprecated: v4.0.0
939945
> Stability: 0 - Deprecated
940946
941947
* `object` {any}
948+
* Returns: {boolean}
942949

943950
Returns `true` if the given `object` is a `Function`. Otherwise, returns
944951
`false`.
@@ -966,6 +973,7 @@ deprecated: v4.0.0
966973
> Stability: 0 - Deprecated
967974
968975
* `object` {any}
976+
* Returns: {boolean}
969977

970978
Returns `true` if the given `object` is strictly `null`. Otherwise, returns
971979
`false`.
@@ -990,6 +998,7 @@ deprecated: v4.0.0
990998
> Stability: 0 - Deprecated
991999
9921000
* `object` {any}
1001+
* Returns: {boolean}
9931002

9941003
Returns `true` if the given `object` is `null` or `undefined`. Otherwise,
9951004
returns `false`.
@@ -1014,6 +1023,7 @@ deprecated: v4.0.0
10141023
> Stability: 0 - Deprecated
10151024
10161025
* `object` {any}
1026+
* Returns: {boolean}
10171027

10181028
Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`.
10191029

@@ -1039,6 +1049,7 @@ deprecated: v4.0.0
10391049
> Stability: 0 - Deprecated
10401050
10411051
* `object` {any}
1052+
* Returns: {boolean}
10421053

10431054
Returns `true` if the given `object` is strictly an `Object` **and** not a
10441055
`Function`. Otherwise, returns `false`.
@@ -1065,6 +1076,7 @@ deprecated: v4.0.0
10651076
> Stability: 0 - Deprecated
10661077
10671078
* `object` {any}
1079+
* Returns: {boolean}
10681080

10691081
Returns `true` if the given `object` is a primitive type. Otherwise, returns
10701082
`false`.
@@ -1101,6 +1113,7 @@ deprecated: v4.0.0
11011113
> Stability: 0 - Deprecated
11021114
11031115
* `object` {any}
1116+
* Returns: {boolean}
11041117

11051118
Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`.
11061119

@@ -1124,6 +1137,7 @@ deprecated: v4.0.0
11241137
> Stability: 0 - Deprecated
11251138
11261139
* `object` {any}
1140+
* Returns: {boolean}
11271141

11281142
Returns `true` if the given `object` is a `string`. Otherwise, returns `false`.
11291143

@@ -1149,6 +1163,7 @@ deprecated: v4.0.0
11491163
> Stability: 0 - Deprecated
11501164
11511165
* `object` {any}
1166+
* Returns: {boolean}
11521167

11531168
Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`.
11541169

@@ -1172,6 +1187,7 @@ deprecated: v4.0.0
11721187
> Stability: 0 - Deprecated
11731188
11741189
* `object` {any}
1190+
* Returns: {boolean}
11751191

11761192
Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
11771193

0 commit comments

Comments
 (0)