From 553d4ee57db12ef9f1c039985024c2e4f79fd815 Mon Sep 17 00:00:00 2001 From: Peter Dalgaard-Jensen Date: Wed, 24 Jan 2018 16:54:14 +0100 Subject: [PATCH] doc: fix return value for require.resolve.paths() Update documentation of modules.md for require.resolve.paths() to include the possibillity of null as a return value if the request string given matches a core module name. PR-URL: https://github.com/nodejs/node/pull/18350 Fixes: https://github.com/nodejs/node/issues/18230 Reviewed-By: Vse Mozhet Byt Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/modules.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index 64048cebe87855..157ec3b6f715b9 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -626,9 +626,11 @@ added: v8.9.0 --> * `request` {string} The module path whose lookup paths are being retrieved. -* Returns: {Array} +* Returns: {Array|null} -Returns an array containing the paths searched during resolution of `request`. +Returns an array containing the paths searched during resolution of `request` or +null if the `request` string references a core module, for example `http` or +`fs`. ## The `module` Object