From e42600fc4b4263364c5030c83507ff982765becf Mon Sep 17 00:00:00 2001 From: Sho Miyamoto Date: Wed, 14 Feb 2018 16:17:14 +0900 Subject: [PATCH] doc: add missing `Returns` in fs & util Backport-PR-URL: https://github.com/nodejs/node/pull/19127 PR-URL: https://github.com/nodejs/node/pull/18775 Reviewed-By: Weijia Wang Reviewed-By: Ruben Bridgewater Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Vse Mozhet Byt Reviewed-By: Luigi Pinca Reviewed-By: Roman Reiss --- doc/api/fs.md | 16 ++++++++++++++++ doc/api/util.md | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index dee32e8696a7c2..34320bcf1fdafa 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1198,6 +1198,7 @@ changes: * `start` {integer} * `end` {integer} * `highWaterMark` {integer} +* Returns: {ReadStream} Returns a new [`ReadStream`][] object. (See [Readable Streams][]). @@ -1273,6 +1274,7 @@ changes: * `mode` {integer} * `autoClose` {boolean} * `start` {integer} +* Returns: {WriteStream} Returns a new [`WriteStream`][] object. (See [Writable Stream][]). @@ -1428,6 +1430,7 @@ changes: --> * `path` {string|Buffer|URL} +* Returns: {boolean} Synchronous version of [`fs.exists()`][]. Returns `true` if the path exists, `false` otherwise. @@ -1546,6 +1549,7 @@ added: v0.1.95 --> * `fd` {integer} +* Returns: {fs.Stats} Synchronous fstat(2). Returns an instance of [`fs.Stats`][]. @@ -1820,6 +1824,7 @@ changes: --> * `path` {string|Buffer|URL} +* Returns: {fs.Stats} Synchronous lstat(2). Returns an instance of [`fs.Stats`][]. @@ -1945,6 +1950,7 @@ added: v5.10.0 * `prefix` {string} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string} The synchronous version of [`fs.mkdtemp()`][]. Returns the created folder path. @@ -2069,6 +2075,7 @@ changes: * `path` {string|Buffer|URL} * `flags` {string|number} * `mode` {integer} **Default:** `0o666` +* Returns: {number} Synchronous version of [`fs.open()`][]. Returns an integer representing the file descriptor. @@ -2159,6 +2166,7 @@ changes: * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {Array} An array of filenames Synchronous readdir(3). Returns an array of filenames excluding `'.'` and `'..'`. @@ -2260,6 +2268,7 @@ changes: * `options` {Object|string} * `encoding` {string|null} **Default:** `null` * `flag` {string} **Default:** `'r'` +* Returns: {string|Buffer} Synchronous version of [`fs.readFile()`][]. Returns the contents of the `path`. @@ -2320,6 +2329,7 @@ changes: * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string|Buffer} Synchronous readlink(2). Returns the symbolic link's string value. @@ -2342,6 +2352,7 @@ changes: * `offset` {integer} * `length` {integer} * `position` {integer} +* Returns: {number} Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. @@ -2452,6 +2463,7 @@ changes: * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string|Buffer} Synchronously computes the canonical pathname by resolving `.`, `..` and symbolic links. @@ -2482,6 +2494,7 @@ added: v9.2.0 * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string|Buffer} Synchronous realpath(3). @@ -2619,6 +2632,7 @@ changes: --> * `path` {string|Buffer|URL} +* Returns: {fs.Stats} Synchronous stat(2). Returns an instance of [`fs.Stats`][]. @@ -3197,6 +3211,7 @@ changes: * `offset` {integer} * `length` {integer} * `position` {integer} +* Returns: {number} ## fs.writeSync(fd, string[, position[, encoding]])