From 98a7026311a1f9d96f1a819982ad5524a5da64e7 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 8b06b02f2f2c6b..1b5f9a2b708777 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`