Skip to content

Commit 4cc5e96

Browse files
aduh95targos
authored andcommitted
doc: document module.path
Refs: #26970 Fixes: #33270 PR-URL: #33323 Reviewed-By: Anna Henningsen <[email protected]>
1 parent c1fe152 commit 4cc5e96

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/api/modules.md

+12
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ node entry.js
688688
```js
689689
Module {
690690
id: '.',
691+
path: '/absolute/path/to',
691692
exports: {},
692693
parent: null,
693694
filename: '/absolute/path/to/entry.js',
@@ -899,6 +900,16 @@ added: v0.1.16
899900

900901
The module that first required this one.
901902

903+
### `module.path`
904+
<!-- YAML
905+
added: v11.14.0
906+
-->
907+
908+
* {string}
909+
910+
The directory name of the module. This is usually the same as the
911+
[`path.dirname()`][] of the [`module.id`][].
912+
902913
### `module.paths`
903914
<!-- YAML
904915
added: v0.4.0
@@ -1110,6 +1121,7 @@ consists of the following keys:
11101121
[`__filename`]: #modules_filename
11111122
[`createRequire()`]: #modules_module_createrequire_filename
11121123
[`module` object]: #modules_the_module_object
1124+
[`module.id`]: #modules_module_id
11131125
[`path.dirname()`]: path.html#path_path_dirname_path
11141126
[ECMAScript Modules]: esm.html
11151127
[an error]: errors.html#errors_err_require_esm

0 commit comments

Comments
 (0)