-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Launching main ESM module with search and hash #49204
Copy link
Copy link
Closed as not planned
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale
Type
Fields
Give feedbackNo fields configured for issues without a type.
What is the problem this feature will solve?
We can provide query and hash in ESM imports:
However, AFAICT there is no way to provide them directly to main module:
What is the feature you are proposing to solve the problem?
Command line option(s) to provide
searchandhash, e.g.What alternatives have you considered?
Right now we can do this with empty script:
Which
import.meta.isMainprocess.argvbecauseprocess.argv[1]will contain first argument instead of path to2.mjs.or.., and to use forward slashes on Windows