Skip to content

Commit

Permalink
doc: document module.path
Browse files Browse the repository at this point in the history
Refs: #26970
Fixes: #33270

PR-URL: #33323
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
aduh95 authored and targos committed Jun 2, 2020
1 parent c1fe152 commit 4cc5e96
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ node entry.js
```js
Module {
id: '.',
path: '/absolute/path/to',
exports: {},
parent: null,
filename: '/absolute/path/to/entry.js',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4cc5e96

Please sign in to comment.