A zero-dependency alternative to cosmiconfig for loading configuration files
89
Build a configuration loading system that measures and optimizes the performance of loading configuration files using caching. The system should be able to load configuration files multiple times, measure the performance difference with and without caching, and provide cache management capabilities.
Provides configuration file search and loading capabilities with caching support.
Create a module that provides configuration loading functionality with performance tracking:
Implement functionality to measure performance differences:
Provide cache control operations:
Create the following files:
config-loader.js - Main module implementing the configuration loader with cachingconfig-loader.test.js - Test file demonstrating the caching behaviorDescription: Loading the same configuration file multiple times should show significant performance improvement due to caching.
Steps:
test.config.json)Expected Result: The cached load (second load) should be noticeably faster than the initial load, demonstrating the caching optimization.
Description: Clearing the cache should cause subsequent loads to perform like initial loads.
Steps:
Expected Result: After clearing the cache, the load time should be similar to the initial load time, confirming that the cache was successfully cleared.
Description: Different configuration files should be cached independently.
Steps:
Expected Result: Each file maintains its own cache entry, and clearing the cache affects all cached files.
performance.now()) for accurate performance measurementsInstall 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