A zero-dependency alternative to cosmiconfig for loading configuration files
89
Build a configuration file loader that efficiently manages caching of search and load operations. The system should maintain separate caches for search results and file loads, and provide methods to clear these caches individually or together.
Clears only the search cache while preserving load cache.
Clears only the load cache while preserving search cache.
Clears both search and load caches completely.
Verify that cached results return the same object reference (identity equality).
@generates
/**
* Creates a configuration explorer with caching capabilities
* @param {string} name - The name to use for configuration file search
* @param {Object} options - Configuration options
* @param {boolean} [options.cache=true] - Enable or disable caching
* @returns {Object} Explorer object with search, load, and cache management methods
*/
function createExplorer(name, options) {
// Returns an object with the following methods:
// - search(searchFrom?) - Search for config starting from a directory
// - load(filepath) - Load a specific config file
// - clearSearchCache() - Clear only the search cache
// - clearLoadCache() - Clear only the load cache
// - clearCaches() - Clear both caches
}
module.exports = { createExplorer };Provides configuration file discovery and loading with built-in caching support.
@satisfied-by
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