All notable changes to this project will be documented in this file.
- Support default values for environment variable templates.
- example:
api: port: ${PORT:3000}
- example:
- Update runtypes to 6.7.0
- Add support for modular configuration.
-
The default
load
function has been removed, though it is still available. Callers should instead use the newinitialize
function to load configuration and get an instance ofTconf
.- before:
import loadConfig from 'tconf'; const config = loadConfig({...}) export default config;
- after:
import { initialize } from 'tconf'; // export our tconf instance so modules can register their own configuration // (without having to make it global to the entire application) export const tconf = initialize({...}) export default tconf.get();
- before:
- Upgrade eslint packages.
Optional
fields now processed correctly when performing env coercion. For example, the following should be able to be mapped correctly from env vars:This was previously failing to recognize theconst DbConfig = Record({ host: String, database: Optional(String), });
Optional
.- Fixed an issue with env config merging. Nested properties were being assigned at the wrong path.
- Add LICENSE file
- Only include required files in package
- Clean up code
- Update README
- Package updates
- Add support for coercion of env vars to array
- Ignore empty files
- Update dependencies.
- Add missing parsers file.
- Code reorganization
- README update
- Add support for json5
- Add
format
config value for 'yml'. This is also used as the file extension. Previously, only '.yaml' was supported. You can now use '.yml' or '.yaml'.