-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
Incomplete documentation require() #23106
Copy link
Copy link
Closed
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.questionIssues that look for answers.Issues that look for answers.
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.questionIssues that look for answers.Issues that look for answers.
Incomplete documentation at https://nodejs.org/dist/latest-v8.x/docs/api/modules.html#modules_require
It states no use cases.
require()is widely used for reading.jsonfiles.Is it safe to apply
require()over.json? Are there any guarantees that.jsonfile is allowed to contain single JSON object only? Are there any guaranteesrequire()ing a.jsonfile containing valid JS code will never lead to interpreting the code?