-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Open
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.
Description
What is the problem this feature will solve?
It's a nice way to accept both URL
and path string in API, but we need covert it to either string or URL, it would be nice to have a built-in method to do this.
What is the feature you are proposing to solve the problem?
For converting to string:
Maybe add path.from(URL | string)
? @sindresorhus proposed here.
For converting to URL:
url.from(URL | string)
I'm not sure, since URL
is a standard, I guess adding method URL
object won't be acceptable, maybe to node:url
module?
What alternatives have you considered?
No response
sindresorhus, szmarczak, penx and TheOneTheOnlyJJ
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.
Type
Projects
Status
Triaged