Add a utility to convert file URL or path to one of them?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the proposed path.from(URL | string) and url.from(URL | string) APIs, along with the node:url module mentioned in the issue. Determine which conversion semantics and module ownership are appropriate; the work is done when one API shape and its behavior are clearly specified and implemented with corresponding coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100