From 997f01b92f52c9c8f035d305415c504c5e164213 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 --- 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`