Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: align code example with actual code behavior
module.createRequireFromPath() takes a filename as argument. But the accompanying code example in the documentation makes it seem like it can take a directory argument as well. However, if a directory is passed as argument instead of a filename, then the function does not work as expected. Therefore, the fix is to make explicit in the code example that only filenames could be passed to module.createRequireFromPath() and not directory names. Fixes: #23710 Refs: #24763 (comment)
- Loading branch information