Gathering detailed insights and metrics for lilconfig
Gathering detailed insights and metrics for lilconfig
Gathering detailed insights and metrics for lilconfig
Gathering detailed insights and metrics for lilconfig
npm install lilconfig
Typescript
Module System
Min. Node Version
Node Version
NPM Version
v3.1.3 Windows friendly
Updated on Dec 03, 2024
v3.1.2 Webpack friendly
Updated on Jun 09, 2024
v3.1.1 Security release
Updated on Feb 18, 2024
v3.1.0 Support ESM config files (async api only)
Updated on Feb 14, 2024
v3.0.0 Cache support
Updated on Nov 19, 2023
v2.1.0 adds support for `.config/<name>rc` files
Updated on Mar 02, 2023
JavaScript (99.88%)
CoffeeScript (0.06%)
TypeScript (0.05%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
176 Stars
139 Commits
10 Forks
2 Watchers
3 Branches
9 Contributors
Updated on Jul 14, 2025
Latest Version
3.1.3
Package Id
lilconfig@3.1.3
Unpacked Size
17.54 kB
Size
5.10 kB
File Count
5
NPM Version
10.8.1
Node Version
23.3.0
Published on
Dec 03, 2024
Cumulative downloads
Total Downloads
A zero-dependency alternative to cosmiconfig with the same API.
1npm install lilconfig
1import {lilconfig, lilconfigSync} from 'lilconfig'; 2 3// all keys are optional 4const options = { 5 stopDir: '/Users/you/some/dir', 6 searchPlaces: ['package.json', 'myapp.conf.js'], 7 ignoreEmptySearchPlaces: false 8} 9 10lilconfig( 11 'myapp', 12 options // optional 13).search() // Promise<LilconfigResult> 14 15lilconfigSync( 16 'myapp', 17 options // optional 18).load(pathToConfig) // LilconfigResult 19 20/** 21 * LilconfigResult 22 * { 23 * config: any; // your config 24 * filepath: string; 25 * } 26 */
ESM configs can be loaded with async API only. Specifically js
files in projects with "type": "module"
in package.json
or mjs
files.
cosmiconfig
Lilconfig 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
1import {lilconfig} from 'lilconfig'; 2import yaml from 'yaml'; 3 4function loadYaml(filepath, content) { 5 return yaml.parse(content); 6} 7 8const options = { 9 loaders: { 10 '.yaml': loadYaml, 11 '.yml': loadYaml, 12 // loader for files with no extension 13 noExt: loadYaml 14 } 15}; 16 17lilconfig('myapp', options) 18 .search() 19 .then(result => { 20 result // {config, filepath} 21 });
8.8/10
Summary
lilconfig Code Injection vulnerability
Affected Versions
>= 3.1.0, < 3.1.1
Patched Versions
3.1.1
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 6
Details
Reason
Found 2/11 approved changesets -- score normalized to 1
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreLast Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year