Skip to content

fs.promises.stat: Missing option throwIfNoEntry #61116

@mindplay-dk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    Status

    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions