Package Exports
- lilconfig
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lilconfig) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Lilconfig ⚙️
A tiny replacement for cosmiconfig with similar API.
Installation
npm install lilconfigUsage
import {lilconfig, lilconfigSync} from 'lilconfig';
// all keys are optional
const options = {
stopDir: '/Users/you/some/dir',
searchPlaces: ['package.json', 'myapp.config.js'],
ignoreEmptySearchPlaces: true
}
lilconfig(
'myapp',
options // optional
).search() // Promise<LilconfigResult>
lilconfigSync(
'myapp',
options // optional
).load(pathToConfig) // LilconfigResult
/*
* LilconfigResult
* {
* config: any; // your config
* path: string;
* }
*/Difference to cosmiconfig
Lilconfig does not intend to be 100% compatible with cosmiconfig but tries to mimic it where possible. The key differences are:
- not support yaml files out of the box(
lilconfigattempts to parse files with no extension as JSON files instead of YAML) - no cache
Options difference between the two.
| cosmiconfig option name | lilconfig |
|---|---|
| cache | ❌ |
| loaders | ✅ |
| ignoreEmptySearchPlaces | ✅ |
| packageProp | ✅ |
| searchPlaces | ✅ |
| stopDir | ✅ |
| transform | ✅ |