fs.exists does not follow node conventions #8369
Comments
If you look in the Node's docs you'll see that |
Hmm, while I agree that the error parameter would be redundant, i don't agree that being the only special case is worth removing that redundancy. In any case, it sounds like its a moot point if exists is essentially deprecated. Tho I'm not sure i'm comfortable using exceptions that way.. |
is also causes problems with |
cc @tjfontaine |
How about changing it in the way that it gives the callback two parameters if the provided callback wants two. This way we have the backward compatibility and the consistency of callback definitions in Node. |
+1 from me for changing the API. There's not really a way to deprecate the change, so I say we standardize. @indutny any objections from you? |
If you decide to make this change, I've opened a PR. If you decide against it, feel free to close it. |
If we're digging into this can I ask for an |
@cjihrig Thanks for the PR. I'll continue further discussion there. @refack I assume |
@trevnorris I'm talking about a special case optimization - 9dae54a |
This is being overridden by #8418. |
fs.exists
is the only function in all of node that has a callback that isn't in the errback form (a callback that takes an error as its first parameter). This wastes about 10 minutes of my time every time i forget about it. Please change this to be consistent with the rest of the node ecosystem.The text was updated successfully, but these errors were encountered: