Skip to content

Commit 1b8e8e9

Browse files
Trottaddaleax
authored andcommitted
doc: make minor improvements to fs.realpath() docs
Make canonical vs. unique text more precise and eliminate quotation marks. Remove repeated text from fs.realpathSync(), linking to fs.realpath() instead. PR-URL: #20953 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b2808ed commit 1b8e8e9

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

doc/api/fs.md

+3-21
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,7 @@ changes:
24812481
Asynchronously computes the canonical pathname by resolving `.`, `..` and
24822482
symbolic links.
24832483

2484-
Note that "canonical" does not mean "unique": hard links and bind mounts can
2484+
A canonical pathname is not necessarily unique. Hard links and bind mounts can
24852485
expose a file system entity through many pathnames.
24862486

24872487
This function behaves like realpath(3), with some exceptions:
@@ -2556,26 +2556,7 @@ changes:
25562556
* `encoding` {string} **Default:** `'utf8'`
25572557
* Returns: {string|Buffer}
25582558

2559-
Synchronously computes the canonical pathname by resolving `.`, `..` and
2560-
symbolic links.
2561-
2562-
Note that "canonical" does not mean "unique": hard links and bind mounts can
2563-
expose a file system entity through many pathnames.
2564-
2565-
This function behaves like realpath(3), with some exceptions:
2566-
2567-
1. No case conversion is performed on case-insensitive file systems.
2568-
2569-
2. The maximum number of symbolic links is platform-independent and generally
2570-
(much) higher than what the native realpath(3) implementation supports.
2571-
2572-
The optional `options` argument can be a string specifying an encoding, or an
2573-
object with an `encoding` property specifying the character encoding to use for
2574-
the returned value. If the `encoding` is set to `'buffer'`, the path returned
2575-
will be passed as a `Buffer` object.
2576-
2577-
If `path` resolves to a socket or a pipe, the function will return a system
2578-
dependent name for that object.
2559+
Synchronous version of [`fs.realpath()`][]. Returns the resolved pathname.
25792560

25802561
## fs.realpathSync.native(path[, options])
25812562
<!-- YAML
@@ -4690,6 +4671,7 @@ the file contents.
46904671
[`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback
46914672
[`fs.readFile()`]: #fs_fs_readfile_path_options_callback
46924673
[`fs.readFileSync()`]: #fs_fs_readfilesync_path_options
4674+
[`fs.realpath()`]: #fs_fs_realpath_path_options_callback
46934675
[`fs.rmdir()`]: #fs_fs_rmdir_path_callback
46944676
[`fs.stat()`]: #fs_fs_stat_path_callback
46954677
[`fs.utimes()`]: #fs_fs_utimes_path_atime_mtime_callback

0 commit comments

Comments
 (0)