Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.cjs files always need their extension to be included
  • Loading branch information
aduh95 committed Jan 1, 2022
commit 5ed7e1cdf3d36a4e396e6cceade02743f872b4ea
4 changes: 3 additions & 1 deletion doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ correctly within an application.

If the exact filename is not found, then Node.js will attempt to load the
required filename with the added extensions: `.js`, `.json`, and finally
`.node`.
`.node`. When loading a file that has a different extension (e.g. `.cjs`), its
full name must be included, including its file extension (e.g.
`require('./file.cjs')`).

`.json` files are parsed as JSON text files, `.node` files are interpreted as
compiled addon modules loaded with `process.dlopen()`. Files using any other
Expand Down