-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
fs.promises.stat: Missing option throwIfNoEntry #61116
Copy link
Copy link
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Awaiting Triage
What is the problem this feature will solve?
For some reason
fs.promises.statis missing the optionthrowIfNoEntrythat was added tofs.statin version 14/15.What is the feature you are proposing to solve the problem?
Add the option for parity with the sync version of this function.
What alternatives have you considered?
The only alternative is a
try/catch, which creates an annoying scoping issue you have to work around.It's just surprising, when converting some code from
fs.stattofs.promises.statand it would seem natural to expect the API to be the same, just async.