A zero-dependency alternative to cosmiconfig for loading configuration files
89
Build a tool that searches for project configuration files by traversing up the directory tree from a given starting point.
You need to implement a configuration file finder that can locate project-specific configuration files. The finder should start from a given directory and search upward through parent directories until it finds a configuration file or reaches a specified stopping point.
Your implementation should handle the following scenarios:
Implement a configuration finder with the following behavior:
The finder should search for configuration files in these locations (in order):
package.json (with a specific property for your configuration).apprc.json.config/apprc.jsonapp.config.jsCreate a module that exports a function to create a configuration explorer. The explorer should have a search method that accepts an optional starting directory.
@generates
Provides configuration file search and loading capabilities.
Install with Tessl CLI
npx tessl i tessl/npm-lilconfigdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10