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
Seemingly-inconsistent fallback behavior #15
Labels
Comments
@jugglinmike sorry for ignoring this for so long; I don't honestly remember the original reasoning for falling back to I also wonder will |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of version 1.0.2, this module returns the current working directory when the "main" module cannot be identified:
This means the return value may describe a file or a directory; consumers must determine which before they can use it safely. Because this behavior is undocumented, I first guessed this was an oversight. However, there is an explicit test for it:
Can any of the maintainers explain the rationale for this behavior? And since it differs from the Node.js feature that this module is intended to mimic, can that be added to the project documentation?
I'm also curious if the function signature could be extended with an "options" object to enable "strict" behavior, where
undefined
is returned in cases where themain
module is undefined.The text was updated successfully, but these errors were encountered: