Update fs.markdown to account for correct uses of fs.exists()#7944
Update fs.markdown to account for correct uses of fs.exists()#7944oconnore wants to merge 1 commit intonodejs:masterfrom oconnore:patch-1
Conversation
`fs.exists()` is not an anti-pattern in itself. It becomes an anti-pattern when used in a particular way. Checking the existence of a file is quite useful when building filesystem based locks, and the documentation shouldn't be so narrow in its assumptions.
|
@oconnore |
|
@vkurchatkin ah, but an api inconsistency is different than what the documentation is saying. In that case, the documentation should describe the inconsistency (lack of |
|
@oconnore it should, I guess. Actually |
|
Closing this here. A new PR has been opened in http://github.com/nodejs/node |
per: nodejs/node-v0.x-archive#7944 originally submitted by @oconnore Minor update to the description in `fs.exists()`
per: nodejs/node-v0.x-archive#7944 originally submitted by @oconnore Minor update to the description in `fs.exists()` Reviewed By: Sakthipriyan Vairamani <[email protected]> PR-URL: #2378
per: nodejs/node-v0.x-archive#7944 originally submitted by @oconnore Minor update to the description in `fs.exists()` Reviewed By: Sakthipriyan Vairamani <[email protected]> PR-URL: #2378
fs.exists()is not an anti-pattern in itself. It becomes an anti-pattern when used in a particular way. Checking the existence of a file is quite useful when, for example, checking filesystem based locks or status files (of course, grabbing a lock is the same problem, and should usefs.open()directly), and the documentation shouldn't be so narrow in its assumptions.