3 ms·
I load config files as JS (not JSON). And only use JSON for data serialization. In plain JS you can have comments and dont have to put quotes around properties
by z3t4 6y ago
I load config files as JS (not JSON). And only use JSON for data serialization. In plain JS you can have comments and dont have to put quotes around properties. Not saying everyone should have a full JS parser for their config files, but its really nice.
- eska 6y agoSo you're running eval on your config data? Not feasible for external data.
- z3t4 6y agoIn module context. Then var config = require("settings.js"); My reasoning is that if you have access to change config or source code, all bets are off. Or you could parse the config in a separate vm and import the result as JSON.