Configuration Files
Last updated
Was this helpful?
Last updated
Was this helpful?
Properties:
Simple configuration
Values can only be a string or a number
No complicated values
Useful when making minor flags or changes
Human readable
Example:
If possible use JSON5 over JSON.
From
Properties:
Nested configuration
Uses an already familiar programming paradigm
Human readable
Example:
Properties:
Complicated
Overly verbose
Useful for computers interfacing with each other
Properties:
Can get complex with the "repeated nodes" syntax
Spacing is important, which can throw off the configuration
Isn't immediately obvious when something is a list/array or a map
Properties:
Cannot be deeply nested
Example: mixing .env and JSON5
When you need a mix of simple and complex data structures?
JSON objects should only be read once.
Environment variables can be read multiple times in the system.
Limit it to just two.
Don't mix too many formats. Too many different rules to remember. Or use different format for communication between services (ie: JSON, or XML files)
No. Unless you have a really good reason.
You have to create a parser.
The JSON5 Data Interchange Format (JSON5) is a superset of that aims to alleviate some of the limitations of JSON by expanding its syntax to include some productions from .