You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
As noted above, this behavior is specified. That being said, just "To require modules." is practically not even documentation. it should be expanded in some way regardless.
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 guaranteesrequire()
ing a.json
file containing valid JS code will never lead to interpreting the code?The text was updated successfully, but these errors were encountered: