Repository navigation
Add a way to get the enabled conditions #55824
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Nov 12, 2024 - addedmoduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.
on Nov 14, 2024 github-actions commented
on May 13, 2025 on May 13, 2025 – with GitHub ActionsContributorMore actionsThere has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale
Issues and PRs exempt from automated stale handling. label or close this issue if it should be closed. If not, the issue will be automatically 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.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on May 13, 2025 github-actions commented
on Jun 12, 2025 on Jun 12, 2025 – with GitHub ActionsContributorMore actionsThere 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.
Reacted by Ryan SuhartantoThe PR is open at #57688 and is approved by 3 people.
- added a commit that references this issue
on Aug 19, 2025
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriaged
What is the problem this feature will solve?
Currently there is no way to get the enabled conditions easily. It requires checking
process.env.NODE_OPTIONSandprocess.execArgvwhich is not robust. It should be noted that although it is an edge case, theprocess.env.NODE_OPTIONScheck should be done before any code that modifies that variable.Some concrete cases:
parentparameter ofimport.meta.resolveis out of experimental, but I guess exposingconditionsis less controversial than graduating that API from experimental)requireorimportso it uses the custom resolver. If Vite usesrequireorimport, the resolve result is gets cached and requires the program to be restarted.customconditions, to show a warning they have to parse the conditions to do that for now.What is the feature you are proposing to solve the problem?
Add
conditionsvariable innode:module.Example code:
I didn't add
nodetoconditionsin the example above, but maybe it makes sense to add that too.But for
importandrequire, I'm not sure if those should be added in that case. Probably the option would be to add both or neither.What alternatives have you considered?
getOptionValue([Feature] Expose getOptionValue via process.getOptionValue #36935): this one got stale because it is difficult to make the API stable.