-
Notifications
You must be signed in to change notification settings - Fork 30k
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 query parameters (and hash) in CLI paths #33163
Comments
That's pretty much impossible to implement even if it was a good idea because You might counter that no one in their right mind would name a file that way but tools that auto-generate files surely can and probably will. |
The only possible way to handle this would be to require that such input be a proper
This is also just a little bit problematic given that |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment. For more information on how the project manages feature requests, please consult the feature request management document. |
Is your feature request related to a problem? Please describe.
I am interested in having my scripts respond to arguments supplied by the calling file, rather than for the application as a whole (i.e., checking the likes of
new URL(import.meta.url).searchParams.get('someParam')
rather thanprocess.argv
).This works well when a file imports another. In polyglot files too, it works to get the query string and hash in the browser (Chrome or Firefox at least) no matter whether the import originates in HTML or in JavaScript.
But I get a
MODULE_NOT_FOUND
error when trying the likes of:node --experimental-modules index.mjs?someParam=1
...apparently as it is looking for a file here rather than a (portion of) a URL.
Describe the solution you'd like
Allow the supplied file to be treated as a URL at least as far as the query string and any hash.
Describe alternatives you've considered
It duplicates effort to add special
process.argv
handling (and it could interfere if the same file is used in an application which has a different root file yet checksprocess.argv
as well asimport.meta.url
).Thanks!
The text was updated successfully, but these errors were encountered: