Skip to content

Incomplete documentation require() #23106

@soulne4ny

Description

@soulne4ny

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 .json files.
Is it safe to apply require() over .json? Are there any guarantees that .json file is allowed to contain single JSON object only? Are there any guarantees require()ing a .json file containing valid JS code will never lead to interpreting the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.moduleIssues and PRs related to the module subsystem.questionIssues that look for answers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions