diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2020-05-09 14:02:47 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-05-20 01:09:19 +0300 |
commit | a82001a387afa133590420c98efb6b87ad320bfb (patch) | |
tree | ee90aa1a7865a0f261ae03c6cfac739935ff0a35 /doc/api/modules.md | |
parent | 38f444060b0527afe5dccc44ee2db55c73c62e57 (diff) |
doc: document module.path
Refs: https://github.com/nodejs/node/pull/26970
Fixes: https://github.com/nodejs/node/issues/33270
PR-URL: https://github.com/nodejs/node/pull/33323
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc/api/modules.md')
-rw-r--r-- | doc/api/modules.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/api/modules.md b/doc/api/modules.md index aec88a936ba..afbc849180b 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -688,6 +688,7 @@ node entry.js ```js Module { id: '.', + path: '/absolute/path/to', exports: {}, parent: null, filename: '/absolute/path/to/entry.js', @@ -899,6 +900,16 @@ added: v0.1.16 The module that first required this one. +### `module.path` +<!-- YAML +added: v11.14.0 +--> + +* {string} + +The directory name of the module. This is usually the same as the +[`path.dirname()`][] of the [`module.id`][]. + ### `module.paths` <!-- YAML added: v0.4.0 @@ -1110,6 +1121,7 @@ consists of the following keys: [`__filename`]: #modules_filename [`createRequire()`]: #modules_module_createrequire_filename [`module` object]: #modules_the_module_object +[`module.id`]: #modules_module_id [`path.dirname()`]: path.html#path_path_dirname_path [ECMAScript Modules]: esm.html [an error]: errors.html#errors_err_require_esm |