
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
A zero-dependency alternative to cosmiconfig with the same API.
npm install lilconfig
import {lilconfig, lilconfigSync} from 'lilconfig';
// all keys are optional
const options = {
stopDir: '/Users/you/some/dir',
searchPlaces: ['package.json', 'myapp.conf.js'],
ignoreEmptySearchPlaces: false
}
lilconfig(
'myapp',
options // optional
).search() // Promise<LilconfigResult>
lilconfigSync(
'myapp',
options // optional
).load(pathToConfig) // LilconfigResult
/**
* LilconfigResult
* {
* config: any; // your config
* filepath: string;
* }
*/
ESM configs can be loaded with async API only. Specifically js files in projects with "type": "module" in package.json or mjs files.
cosmiconfigLilconfig does not intend to be 100% compatible with cosmiconfig but tries to mimic it where possible. The key difference is no support for YAML files out of the box(lilconfig attempts to parse files with no extension as JSON instead of YAML). You can still add the support for YAML files by providing a loader, see an example below.
| cosmiconfig option | lilconfig |
|---|---|
| cache | ✅ |
| loaders | ✅ |
| ignoreEmptySearchPlaces | ✅ |
| packageProp | ✅ |
| searchPlaces | ✅ |
| stopDir | ✅ |
| transform | ✅ |
If you need the YAML support, you can provide your own loader
import {lilconfig} from 'lilconfig';
import yaml from 'yaml';
function loadYaml(filepath, content) {
return yaml.parse(content);
}
const options = {
loaders: {
'.yaml': loadYaml,
'.yml': loadYaml,
// loader for files with no extension
noExt: loadYaml
}
};
lilconfig('myapp', options)
.search()
.then(result => {
result // {config, filepath}
});
Cosmiconfig is a similar package that searches for and loads configuration files. It supports various file formats and has a larger feature set, including caching and transforming configurations. It is more widely used than lilconfig but is also more complex and heavier.
The 'rc' package is another alternative that loads configuration from multiple sources, including command-line arguments, environment variables, and configuration files. It is less focused on file discovery and more on aggregating configuration from different sources.
The 'config' package is designed for managing configurations across different deployment environments. It is more opinionated and structured than lilconfig, with a predefined way of organizing configuration files based on the deployment environment.
FAQs
A zero-dependency alternative to cosmiconfig
The npm package lilconfig receives a total of 0 weekly downloads. As such, lilconfig popularity was classified as not popular.
We found that lilconfig demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.