fs.lstatSync throws when file doesn't exist.
jdalton opened this issue · 5 comments
jdalton commented
jdanford commented
Wow, I should have caught that – thank you!
jdalton commented
jdanford commented
Many file-related functions transparently follow symlinks, in accordance with the behavior of stat()
in POSIX, so fs.existsSync()
is doing the right thing here. More importantly, fs.exists()
and its synchronous counterpart are now deprecated in favor of using fs.stat()
directly, so either way there's no issue!
jdalton commented
Cool!
FWIW fs.existsSync
is not deprecated, only fs.exists
.
(they removed fs.existsSync
from deprecation because of its large ecosystem use)
jdanford commented
My mistake!