NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #375 most downloaded on npm
A zero-dependency alternative to cosmiconfig
Last release 2 years ago
no release in 18 months
Ships fairly regularly
a new release about every 5 months
Most releases are documented
notes for 14 of 16 stable releases
1 version withdrawn
withdrawn after publishing
7 years old
17 releases · first in 2020
One column per quarter.
Default javascript loader can now imports absolute paths on Windows OS. Thanks to @ajiho
Default javascript loader can now imports absolute paths on Windows OS. Thanks to @ajiho
The new changes make lilconfig work as expected when a nodejs app is bundled using webpack.
The new changes make lilconfig work as expected when a nodejs app is bundled using webpack.
Thanks @CHC383
Fix security vulnerability by migrating from typescript to javascript with TSDoc comments. See #48
Due to how typescript compilation works I had to use eval() to have a dynamic import in project compiled to commonjs in v3.1.0. Eval call introduced a security vulnerability as it was pointed out to me by kind people from Secfault Security. As there is currently no way to make typescript output dynamic import with a commonjs target I migrated the source code to be in javascript. This means that the code in this repository is the code that gets published to npm. The package still includes first party typescript types in index.d.ts file that gets published as well. The runtime code now uses TSDoc annotations to maintain type safety.
Lilconfig now supports loading ESM configuration files.
Lilconfig now supports loading ESM configuration files.
ESM configs can be searched or loaded via async API only.
ESM syntax can be valid in either
.js and .mjs files in projects with "type": "module" in package.json.mjs files in projects that use commonjsThanks for pushing this feature @marekdedic
Cache support enabled by default
cache featureLilconfig now can cache results in between searches within the same nodejs process. If you are reusing the searcher to look up configuration files, you will get much faster configuration lookups.
Otherwise you can disable it in options using the new cache key
lilconfig('myapp', {cache: false})--config flag. cosmiconfig will not parse command line arguments. Your application can parse command line arguments and pass them to cosmiconfig.argv config option.sync option.options.configPath is package.json, return the package prop, not the entire JSON file.The default search places for configuration now also searches in the following files:
The default search places for configuration now also searches in the following files:
.config/${name}rc.config/${name}rc.json.config/${name}rc.js.config/${name}rc.cjsThis version should nicely correlate with cosmiconfig v7.1.0
Thanks for reporting @edgan 👏
Thanks for reporting @edgan 👏
Thanks to @michael42 who reported and fixed a bug for async loaders in lilconfig function 👏
Thanks to @michael42 who reported and fixed a bug for async loaders in lilconfig function 👏
You can now add support to ESM configs by providing a custom loader
import {lilconfig} from 'lilconfig';
const loadEsm = filepath => import(filepath);
lilconfig('myapp', {
loaders: {
'.js': loadEsm,
'.mjs': loadEsm,
}
})
.search()
.then(result => {
result // {config, filepath}
result.config.default // if config uses `export default`
});Thanks to @iiroj for highlighting a bug in okonet/lint-staged/issues/1034 where relative paths did not work appropriately when passed to load methods.
Thanks to @iiroj for highlighting a bug in okonet/lint-staged/issues/1034 where relative paths did not work appropriately when passed to load methods. This bug has been fixed and tested to make sure this would not happen again 🙂
There were also a few minor improvements:
.yml key in add loaded example in readmeThis release contains a fix for unix root directory. Please see #17 for more information
This release contains a fix for unix root directory. Please see #17 for more information
Thank you @JounQin for the PR 🙌
Lilconfig got future proof by removing the usage of deprecated nodejs api.
Lilconfig got future proof by removing the usage of deprecated nodejs api.
Thanks to @jeetiss & @TrySound 👏
Fixed: no more infinite loop in Windows.
The breaking changes are the same. To learn more about cosmiconfig v7 click here.
lilconfig v2 is supposed to mimic the functionality of cosmiconfig v7
The breaking changes are the same. To learn more about cosmiconfig v7 click here.
load methods (see README).After carefully testing compatibility with cosmiconfig, lilconfig's first major release is finally ready.
After carefully testing compatibility with cosmiconfig, lilconfig's first major release is finally ready.
lilconfig(name).search([searchPlace]) argument should be optional. Thanks @lttb 🎉
lilconfig(name).search([searchPlace]) argument should be optional. Thanks @lttb 🎉esModuleInterop was disabled to prevent typescript from inlining import helpers into the transpiled code.Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →