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. lilconfig does not plan to:
- support yaml files out of the box
- cache
Options difference between the two.
| Option name | lilconfig | cosmiconfig |
|---|---|---|
| searchPlaces | + | + |
| loaders | - | + |
| packageProp | - | + |
| stopDir | + | + |
| cache | - | + |
| transform | + | + |
| ignoreEmptySearchPlaces | + | + |