Closed
Description
fs.exists
is infamous for having an inconsistent non-nodeback API that confuses new users often and can be a pain spot.
I see two good alternatives:
- Deprecate it, mark it as deprecated in the docs and suggest
fs.stat
instead + discuss the inherent problem with usingexists
(race condition). Add a big warning. Optionallyconsole.log
a deprecation notice when the server is first started. - Change the API to return a nodeback. I like this idea less since it'd have to be written in a way that wouldn't break current code. This sounds harder and less optimal.
Personally I'm for the first. Let's clean up fs
:)