Skip to content

Deprecate fs.exists or fix its API #103

Closed
@benjamingr

Description

@benjamingr

fs.exists is infamous for having an inconsistent non-nodeback API that confuses new users often and can be a pain spot.

I see two good alternatives:

  • Deprecate it, mark it as deprecated in the docs and suggest fs.stat instead + discuss the inherent problem with using exists (race condition). Add a big warning. Optionally console.log a deprecation notice when the server is first started.
  • Change the API to return a nodeback. I like this idea less since it'd have to be written in a way that wouldn't break current code. This sounds harder and less optimal.

Personally I'm for the first. Let's clean up fs :)

Metadata

Metadata

Assignees

Labels

fsIssues and PRs related to the fs subsystem / file system.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions