From f52b56cb007cd4d05afd4a16b0fbe82d015c2fb3 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 9 May 2020 13:02:47 +0200 Subject: [PATCH] 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 --- doc/api/modules.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/modules.md b/doc/api/modules.md index aec88a936ba716..afbc849180b414 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` + + +* {string} + +The directory name of the module. This is usually the same as the +[`path.dirname()`][] of the [`module.id`][]. + ### `module.paths`