-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: clarify symlink resolution for __filename #24587
Conversation
Make it more explicit that symlinks are resolved in `__filename`. Refs: nodejs#22602 (comment)
doc/api/modules.md
Outdated
@@ -491,8 +491,8 @@ added: v0.0.1 | |||
|
|||
* {string} | |||
|
|||
The file name of the current module. This is the resolved absolute path of the | |||
current module file. | |||
The file name of the current module. This is current module file's absolute path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea, but I think file
could be omitted or moved before path
, which might be even clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So either current module's absolute path
or else current module's absolute file path
? It's subtle, but I wonder if that might make someone expect __dirname
value instead of __filename
if a module is loaded or invoked at the directory level (e.g., node .
instead of node index.js
).
One thing this does not mention explicitly is that |
Make it more explicit that symlinks are resolved in `__filename`. Refs: nodejs#22602 (comment) PR-URL: nodejs#24587 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Landed in bb04a8b |
Make it more explicit that symlinks are resolved in `__filename`. Refs: #22602 (comment) PR-URL: #24587 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Make it more explicit that symlinks are resolved in `__filename`. Refs: #22602 (comment) PR-URL: #24587 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Make it more explicit that symlinks are resolved in `__filename`. Refs: nodejs#22602 (comment) PR-URL: nodejs#24587 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Make it more explicit that symlinks are resolved in `__filename`. Refs: #22602 (comment) PR-URL: #24587 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Make it more explicit that symlinks are resolved in `__filename`. Refs: #22602 (comment) PR-URL: #24587 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Make it more explicit that symlinks are resolved in
__filename
.Refs: #22602 (comment)
/ping @sam-github @Pomax
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes