-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: unify dirname and filename description #10527
doc: unify dirname and filename description #10527
Conversation
For a main program this is not necessarily the same as the file name used in the | ||
command line. | ||
|
||
See [`__dirname`][] for the director name of the current module. |
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.
director -> directory
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.
thanks
c7ce4c5
to
da13a15
Compare
The directory name of the current module. This the same as the | ||
[`path.dirname()`][] of the [`__filename`][]. | ||
|
||
`__dirname` isn't actually a global but rather local to each module. |
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.
The wording could be a bit better...
The directory name of the current module. The same value as that returned
by `path.dirname(__filename)`.
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.
Yes, reads better, but if I write it like that its hard to get __filename linked, I'll try to figure out a way.
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.
Found a way, PTAL
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.
LGTM with @jasnell's nit
ee5fcc7
to
134481d
Compare
__dirname is path.dirname(__filename), but its docs, specifically the attempt to describe javascript scope in terms of "running" and "executing" had drifted apart. Rework to describe one as a variation of the other, move the example, and just describe the names in terms of the module, and it's local variables rather than the ill defined execution concepts. Fix: #5525 PR-URL: #10527 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
__dirname is path.dirname(__filename), but its docs, specifically the attempt to describe javascript scope in terms of "running" and "executing" had drifted apart. Rework to describe one as a variation of the other, move the example, and just describe the names in terms of the module, and it's local variables rather than the ill defined execution concepts. Fix: #5525 PR-URL: #10527 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
did not land cleanly on v4.x. Feel free to manually backport |
__dirname is path.dirname(__filename), but its docs, specifically the attempt to describe javascript scope in terms of "running" and "executing" had drifted apart. Rework to describe one as a variation of the other, move the example, and just describe the names in terms of the module, and it's local variables rather than the ill defined execution concepts. Fix: #5525 PR-URL: #10527 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
__dirname is path.dirname(__filename), but its docs, specifically the attempt to describe javascript scope in terms of "running" and "executing" had drifted apart. Rework to describe one as a variation of the other, move the example, and just describe the names in terms of the module, and it's local variables rather than the ill defined execution concepts. Fix: #5525 PR-URL: #10527 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
__dirname is path.dirname(__filename), but its docs, specifically the attempt to describe javascript scope in terms of "running" and "executing" had drifted apart. Rework to describe one as a variation of the other, move the example, and just describe the names in terms of the module, and it's local variables rather than the ill defined execution concepts. Fix: nodejs#5525 PR-URL: nodejs#10527 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
__dirname is path.dirname(__filename), but its docs, specifically the attempt to describe javascript scope in terms of "running" and "executing" had drifted apart. Rework to describe one as a variation of the other, move the example, and just describe the names in terms of the module, and it's local variables rather than the ill defined execution concepts. Fix: #5525 PR-URL: #10527 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
__dirname is path.dirname(__filename), but its docs, specifically the attempt to describe javascript scope in terms of "running" and "executing" had drifted apart. Rework to describe one as a variation of the other, move the example, and just describe the names in terms of the module, and it's local variables rather than the ill defined execution concepts. Fix: #5525 PR-URL: #10527 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
__dirname is path.dirname(__filename), but its docs, specifically the
attempt to describe javascript scope in terms of "running" and
"executing" had drifted apart. Rework to describe one as a variation of
the other, move the example, and just describe the names in terms of the
module, and it's local variables rather than the ill defined execution
concepts.
Fix: #5525
Checklist
Affected core subsystem(s)
doc