-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
fs.promises.stat: Missing option throwIfNoEntry #61116
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
Type
Projects
- StatusShow more project fieldsAwaiting 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.