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: #18350
Fixes: #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 evanlucas committed Jan 30, 2018
1 parent 7d27228 commit 4d3121b
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 4d3121b

Please sign in to comment.