Skip to content
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

support file:// url string path #1022

Closed
jimmywarting opened this issue Oct 20, 2023 · 5 comments
Closed

support file:// url string path #1022

jimmywarting opened this issue Oct 20, 2023 · 5 comments

Comments

@jimmywarting
Copy link

NodeJS dose not really support file://<path> url strings, they need to be converted into URL instances first and formost to be supported.

in the lights of new ESM modules, ppl turn more towards the help of import.meta.url and also the new import.meta.resolve('./worker.js') but this two dose only return file-url-string,

not a url instance.
the lack of file:// strings support in NodeJS is problematic and annoying for many developers.

it leads to unconventional inovation that makes the NodeJS creator inventing even more non standard import.meta properties
that i do not think should be added.

Pushing for a import.meta property that is specific to modules loaded from disk is bad, because it discourages and prevents portability in cases where that is not warranted.

wintercg/proposal-common-minimum-api#50

Here is a quick and dirty solution that i propose: fsURL

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 21, 2023

Sorry, just trying to make sure I understand correctly. You're proposing that fs-extra wraps all fs methods to provide file:// string to URL conversion?

@jimmywarting
Copy link
Author

Yes

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 23, 2023

I don't particularly like the fact that we currently wrap fs, and I'm unsure if I want to add another complexity to that wrapper. Given that the primary source of file:// URLs is import.meta, wouldn't it make sense to instead have a library that wraps that functionality and returns URL instances?

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 23, 2023

Also cc @jprichardson @manidlou @JPeer264 for thoughts here.

@manidlou
Copy link
Collaborator

I agree with @RyanZim, I don't see an absolute necessity for it right now.

@RyanZim RyanZim closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants