Conversation
Adds consistency making 'module.require' strictly equal to 'require'. It is now possible to call module.require.resolve (or any other require properties) on a module object passed outside of the current module.
|
I don't think that this is important enough to justify changing module.js, sorry. We've never claimed that module.require and require are the same function. Can you point to a use case where this matters? |
|
Thank you for your responsiveness ! There is two low level motivations to my suggestion and one high level use case :
Anyway, the framework use case is easy to resolve with external path resolver : What motivated my suggestion is foremost the consistency question noted above. Many thanks for reading this and for the great work done by the Node.js team. |
Maybe, for coherence and clarity
module.requiremust be strictly equal torequireFor instance, even if this is not generally recommended, it should be possible to call something like
module.require.resolve()Very minor change is done here and test included : this is foremost a simple suggestion to be discussed.