{"name":"lilconfig","version":"0.0.3","keywords":["cosmiconfig","config","search"],"author":{"name":"antonk52"},"license":"MIT","_id":"lilconfig@0.0.3","maintainers":[{"name":"antonk52","email":"halloy52@gmail.com"}],"dist":{"shasum":"a24bb99780247c1cbf2b1da849240b49cd81e127","tarball":"http://registry-npm.ywwl.com/lilconfig/download/lilconfig-0.0.3.tgz","fileCount":4,"integrity":"sha512-dpf58BywaMjpW/qhbavJAoCDZvWXjf26ol3hxjWMgG8K8NabhK+KkFFDpdAXGYHpE0bJ7gSlfJpbgqw4Ra22Mg==","signatures":[{"sig":"MEUCIEr114K0O7OO1wETqF4BKE2Ji3Wuw1X2ki9tVVfMxZkhAiEAtCwoDM9Fzuv813IIZLt6g0Vu8Wi5FVzM9gwwAJ0AtsY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCXUfCRA9TVsSAnZWagAA3QQQAJjNcvAQZUrEykh7hje6\n3GgE6ueuAPeQ9UxlUUa7YqfzeYOMlBugxkTXENqdDVUK/D0OwORxREsF9OzX\n+sYvXiGYVrNnxDO86/OvH11vHKNRVjM7GfHdJC6j2RNmgTAT+zUOucM6WvE2\n0uSfz4tHuAO3O7u34lA4rX9cbP066C3YKgdgej86aocTRzosf/JpZ6UmyoFA\n5IHroCRydPUUrmgaYVKt1dCbKaP5DbxUheFN88e290KPJiEKOuhYg8QD1GlI\ny7/kiljQYLIF/baEqK7SKWIV6IqpnSOubxqmFxubiR0z9w7THV6AD3o3EmjO\nJMBj6Vl21PcvXvi6XkDB/Li4Gh3WG03UMRZXUw5ozjayq/barIiHcZZ+Hxhj\nHu8htEwl1FbCgckV1GDE4nGEnmAobsFQGE3aQL1HJl54bkv5VatKb0t3R23j\nE0Ep0X6Rq0M4Kd3cnKixoxAu6OW7Q2bJC300V3HV3k8apS4pyYA3HB5jULiU\nqKwZN36Z79t6eCpsGMyAW++YrnUAqgNdnERuMChXlHmYRI3FWWafHemBra5D\n80ZtHsDPhwIvU+8Jcob9ao3HPRYpModAUcmwNV3W6N8kxBpLZyh+TbNQa8jv\nLG/mWG0xWzNg1gEyo1Si+uj6WGFkLSwzYe7KC1xtgz2liEgvON/m/J773XNd\nZf1t\r\n=aFQC\r\n-----END PGP SIGNATURE-----\r\n","size":3158,"noattachment":false,"key":"/lilconfig/-/lilconfig-0.0.3.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=8"},"gitHead":"c8caa26cc66268befab9af1209a8f1c68a0eb0a6","scripts":{"lint":"eslint ./src/*.ts","test":"echo \"TODO: test for compatibility with cosmiconfig\" && exit 1","build":"tsc --declaration","clean":"rm -rf ./dist","prebuild":"npm run clean","postbuild":"du -h ./dist/*"},"_npmUser":{"name":"antonk52","email":"halloy52@gmail.com"},"_npmVersion":"6.14.5","description":"A tiny replacement to cosmiconfig","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","prettier":"^1.19.1","typescript":"^3.7.5","@types/node":"^13.7.0","eslint-config-prettier":"^6.10.0","eslint-plugin-prettier":"^3.1.2","@typescript-eslint/parser":"^2.19.0","@typescript-eslint/eslint-plugin":"^2.19.0"},"_npmOperationalInternal":{"tmp":"tmp/lilconfig_0.0.3_1594455327036_0.10057242997344562","host":"s3://npm-registry-packages"},"readme":"# Lilconfig ⚙️\n[![npm version](https://badge.fury.io/js/lilconfig.svg)](https://badge.fury.io/js/lilconfig)\n[![install size](https://packagephobia.now.sh/badge?p=lilconfig)](https://packagephobia.now.sh/result?p=lilconfig)\n[![Coverage Status](https://coveralls.io/repos/github/antonk52/lilconfig/badge.svg)](https://coveralls.io/github/antonk52/lilconfig)\n\nA zero-dependency alternative to [cosmiconfig](https://www.npmjs.com/package/cosmiconfig) with the same API.\n\n## Installation\n\n```sh\nnpm install lilconfig\n```\n\n## Usage\n\n```js\nimport {lilconfig, lilconfigSync} from 'lilconfig';\n\n// all keys are optional\nconst options = {\n    stopDir: '/Users/you/some/dir',\n    searchPlaces: ['package.json', 'myapp.conf.js'],\n    ignoreEmptySearchPlaces: false\n}\n\nlilconfig(\n    'myapp',\n    options // optional\n).search() // Promise<LilconfigResult>\n\nlilconfigSync(\n    'myapp',\n    options // optional\n).load(pathToConfig) // LilconfigResult\n\n/**\n * LilconfigResult\n * {\n *   config: any; // your config\n *   filepath: string;\n * }\n */\n```\n\n## ESM\n\nESM configs can be loaded with **async API only**. Specifically `js` files in projects with `\"type\": \"module\"` in `package.json` or `mjs` files.\n\n## Difference to `cosmiconfig`\nLilconfig 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](#yaml-loader) below.\n\n### Options difference between the two.\n\n|cosmiconfig option      | lilconfig |\n|------------------------|-----------|\n|cache                   | ✅        |\n|loaders                 | ✅        |\n|ignoreEmptySearchPlaces | ✅        |\n|packageProp             | ✅        |\n|searchPlaces            | ✅        |\n|stopDir                 | ✅        |\n|transform               | ✅        |\n\n## Loaders examples\n\n### Yaml loader\n\nIf you need the YAML support you can provide your own loader\n\n```js\nimport {lilconfig} from 'lilconfig';\nimport yaml from 'yaml';\n\nfunction loadYaml(filepath, content) {\n    return yaml.parse(content);\n}\n\nconst options = {\n    loaders: {\n        '.yaml': loadYaml,\n        '.yml': loadYaml,\n        // loader for files with no extension\n        noExt: loadYaml\n    }\n};\n\nlilconfig('myapp', options)\n    .search()\n    .then(result => {\n        result // {config, filepath}\n    });\n```\n\n## Version correlation\n\n- lilconig v1 → cosmiconfig v6\n- lilconig v2 → cosmiconfig v7\n- lilconig v3 → cosmiconfig v8\n","publish_time":1594455327179,"_cnpm_publish_time":1594455327179,"dist-tags":{"latest":"3.1.5"}}