Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


So you're running eval on your config data? Not feasible for external data.


In 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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: