Closed jimmywarting closed 9 months ago
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?
Yes
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?
Also cc @jprichardson @manidlou @JPeer264 for thoughts here.
I agree with @RyanZim, I don't see an absolute necessity for it right now.
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 newimport.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.https://github.com/wintercg/proposal-common-minimum-api/issues/50
Here is a quick and dirty solution that i propose: fsURL