Since YAML is a strict superset of JSON, we can accept YAML for all config files in a fully backwards-compatible manner. This is also fully supported by NestJS.
Add js-yaml and @types/js-yaml packages
Replace json.load with yaml.load
Accept .json, .yaml, and .yml file extensions for the config files (stopping with the first one found)
Since YAML is a strict superset of JSON, we can accept YAML for all config files in a fully backwards-compatible manner. This is also fully supported by NestJS.
js-yaml
and@types/js-yaml
packagesjson.load
withyaml.load
.json
,.yaml
, and.yml
file extensions for the config files (stopping with the first one found)