Gathering detailed insights and metrics for @shellscape/lilconfig
Gathering detailed insights and metrics for @shellscape/lilconfig
Gathering detailed insights and metrics for @shellscape/lilconfig
Gathering detailed insights and metrics for @shellscape/lilconfig
npm install @shellscape/lilconfig
84.6
Supply Chain
99.1
Quality
76.9
Maintenance
100
Vulnerability
100
License
v3.1.2 Webpack friendly
Published on 09 Jun 2024
v3.1.1 Security release
Published on 18 Feb 2024
v3.1.0 Support ESM config files (async api only)
Published on 14 Feb 2024
v3.0.0 Cache support
Published on 19 Nov 2023
v2.1.0 adds support for `.config/<name>rc` files
Published on 02 Mar 2023
v2.0.6 adds missing LICENSE file
Published on 10 Jul 2022
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
158 Stars
125 Commits
9 Forks
2 Watching
3 Branches
8 Contributors
Updated on 27 Nov 2024
JavaScript (99.88%)
CoffeeScript (0.06%)
TypeScript (0.05%)
Cumulative downloads
Total Downloads
Last day
-12.2%
1,605
Compared to previous day
Last week
24.9%
7,691
Compared to previous week
Last month
480.1%
30,001
Compared to previous month
Last year
0%
35,480
Compared to previous year
7
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 });
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 6
Details
Reason
Found 1/10 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 2024-11-25
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 More