Skip to content

Commit

Permalink
doc: fix return value for require.resolve.paths()
Browse files Browse the repository at this point in the history
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: nodejs#18350
Fixes: nodejs#18230
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
nephross authored and MayaLekova committed May 8, 2018
1 parent d79faca commit 86c38cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- YAML
Expand Down

0 comments on commit 86c38cf

Please sign in to comment.