Skip to content

Support url *strings* in fs APIs #17658

Closed
@jkrems

Description

@jkrems
  • Version: 7.6.0+
  • Platform: all
  • Subsystem: fs

Right now the FS APIs do support URLs - but only if they are passed as URL objects. This seems to go against the use of URLs in DOM APIs where methods tend to accept strings. E.g. fetch only "accepts" URL objects because they happen to stringify to their .href property.

Would it be acceptable to extend the current support for file URLs to "any string starting with file:// will be treated like a URL object"? This would remove the need for people to manually create import and then instantiate a URL object if they already have a valid file URL (e.g. via import.meta.url).

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.fsIssues and PRs related to the fs subsystem / file system.whatwg-urlIssues and PRs related to the WHATWG URL implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions