Skip to content

Commit 8651ea8

Browse files
mertcanaltinMoLow
authored andcommitted
doc,fs: update description of fs.stat() method
PR-URL: #47654 Fixes: #47633 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name>
1 parent d4eecb5 commit 8651ea8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/api/fs.md

+3
Original file line numberDiff line numberDiff line change
@@ -4066,6 +4066,9 @@ Asynchronous stat(2). The callback gets two arguments `(err, stats)` where
40664066

40674067
In case of an error, the `err.code` will be one of [Common System Errors][].
40684068

4069+
[`fs.stat()`][] follows symbolic links. Use [`fs.lstat()`][] to look at the
4070+
links themselves.
4071+
40694072
Using `fs.stat()` to check for the existence of a file before calling
40704073
`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended.
40714074
Instead, user code should open/read/write the file directly and handle the

0 commit comments

Comments
 (0)