-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for WHATWG URLs #16
Comments
heyy! I was recently thinking of the same thing, as I’m in the process of moving everything over. The error would be a quick fix. Supporting them would be nicer (although: |
This comment has been minimized.
This comment has been minimized.
Here’s the code for That seems fine. |
@aduh95 Is this something you could work on? |
This comment has been minimized.
This comment has been minimized.
Released! |
Initial checklist
Subject
Node.js fs API supports URL for all fs operations, it'd be nice to add support for it
Problem
I'd expect the following to work:
Unfortunately, it's neither a string nor a buffer, no error is reported that I've done something forbidden but the VFile instance does not populate correctly.
Solution
to-vfile could check if the provided object is a
URL
object, and convert it to a path usingfileURLToPath
fromnode:url
module.Alternatives
to-vfile could throw an error if the provided object is a
URL
object, to let the user know they need to convert it themself:The text was updated successfully, but these errors were encountered: