Blog

Tips For App Configuration

If you’re used to running or developing apps that accept arguments from a config file or the command line, you’ve likely spent more time wrestling with configuration syntax than you’re comfortable admitting. Simpl.js takes some of this hassle out of configuration by accepting a single JSON-formatted config object as input to each app. As a developer, this means no getopt and no eval for parsing configuration data, but here are some additional pointers that will improve the user experience when configuring your app:

  • Sane Defaults - Your app should work normally (or log a descriptive error message) if its config object is empty.
  • Backward Compatibility - Rather than reinterpreting a configuration field in a new version of your app, create a separate field and support both.
  • True JSON - Adhere to JSON semantics in your config file; don’t use things like comma-delimited string values or objects with significant key ordering.