8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bec8aa commit 0ae5d02Copy full SHA for 0ae5d02
doc/api/globals.markdown
@@ -30,6 +30,16 @@ console.log(__dirname);
30
31
`__dirname` isn't actually a global but rather local to each module.
32
33
+For instance, given two modules: `a` and `b`, where `b` is a dependency of
34
+`a` and there is a directory structure of:
35
+
36
+* `/Users/mjr/app/a.js`
37
+* `/Users/mjr/app/node_modules/b/b.js`
38
39
+References to `__dirname` within `b.js` will return
40
+`/Users/mjr/app/node_modules/b` while references to `__dirname` within `a.js`
41
+will return `/Users/mj/app`.
42
43
## \_\_filename
44
45
<!-- type=var -->
0 commit comments