Skip to content

fs.promises.stat: Missing option throwIfNoEntry #61116

Description

@mindplay-dk

What is the problem this feature will solve?

For some reason fs.promises.stat is missing the option throwIfNoEntry that was added to fs.stat in 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.stat to fs.promises.stat and it would seem natural to expect the API to be the same, just async.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions