Get Node import conditions at runtime
npm install get-conditionsGet Node import conditions at runtime
``bash`
npm install get-conditions
to influence which paths are used when export or import maps are resolved.However, this information is not available at runtime. This makes it difficult when implementing custom resolvers (e.g. statically analyzing an import path).
Returns: string[]
Example: ['node', 'node-addons', 'foo', 'bar']
Gets the import conditions for the current Node.js process.
require and import are excluded as their existence varies by how the current module was resolved. But you can add require/import` back depending on which resolution type you prefer, before passing in the array into a resolver.
Note, the order of this array does not matter to the resolution algorithm (the order of the condition keys in the map does).