Skip to content

Commit 89d211f

Browse files
committed
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 a25730b commit 89d211f

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
@@ -2491,7 +2491,7 @@ changes:
24912491
Asynchronously computes the canonical pathname by resolving `.`, `..` and
24922492
symbolic links.
24932493

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

24972497
This function behaves like realpath(3), with some exceptions:
@@ -2566,26 +2566,7 @@ changes:
25662566
* `encoding` {string} **Default:** `'utf8'`
25672567
* Returns: {string|Buffer}
25682568

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

25902571
## fs.realpathSync.native(path[, options])
25912572
<!-- YAML
@@ -4516,6 +4497,7 @@ the file contents.
45164497
[`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback
45174498
[`fs.readFile()`]: #fs_fs_readfile_path_options_callback
45184499
[`fs.readFileSync()`]: #fs_fs_readfilesync_path_options
4500+
[`fs.realpath()`]: #fs_fs_realpath_path_options_callback
45194501
[`fs.rmdir()`]: #fs_fs_rmdir_path_callback
45204502
[`fs.stat()`]: #fs_fs_stat_path_callback
45214503
[`fs.utimes()`]: #fs_fs_utimes_path_atime_mtime_callback

0 commit comments

Comments
 (0)