{
  "manifest": {
    "name": "lilconfig",
    "version": "2.1.0",
    "description": "A zero-dependency alternative to cosmiconfig",
    "main": "dist/index.js",
    "types": "dist/index.d.ts",
    "scripts": {
      "prebuild": "npm run clean",
      "build": "tsc --declaration",
      "postbuild": "du -h ./dist/*",
      "clean": "rm -rf ./dist",
      "test": "jest --coverage",
      "lint": "eslint ./src/*.ts"
    },
    "keywords": [
      "cosmiconfig",
      "config",
      "configuration",
      "search"
    ],
    "files": [
      "dist/*"
    ],
    "repository": {
      "type": "git",
      "url": "https://github.com/antonk52/lilconfig"
    },
    "bugs": {
      "url": "https://github.com/antonk52/lilconfig/issues"
    },
    "author": {
      "name": "antonk52"
    },
    "license": "MIT",
    "devDependencies": {
      "@types/jest": "^27.0.2",
      "@types/node": "^14.18.36",
      "@typescript-eslint/eslint-plugin": "^5.54.0",
      "@typescript-eslint/parser": "^5.54.0",
      "cosmiconfig": "^7.1.0",
      "eslint": "^8.35.0",
      "eslint-config-prettier": "^8.6.0",
      "eslint-plugin-prettier": "^4.2.1",
      "jest": "^27.3.1",
      "prettier": "^2.8.4",
      "ts-jest": "27.0.7",
      "typescript": "4.4.4"
    },
    "engines": {
      "node": ">=10"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-lilconfig-2.1.0-78e23ac89ebb7e1bfbf25b18043de756548e7f52-integrity/node_modules/lilconfig/package.json",
    "readmeFilename": "readme.md",
    "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## Difference to `cosmiconfig`\nLilconfig does not intend to be 100% compatible with `cosmiconfig` but tries to mimic it where possible. The key differences are:\n- **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- **no** cache\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### ESM loader\n\nLilconfig 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`.\n\n```js\nimport {lilconfig} from 'lilconfig';\n\nconst loadEsm = filepath => import(filepath);\n\nlilconfig('myapp', {\n    loaders: {\n        '.js': loadEsm,\n        '.mjs': loadEsm,\n    }\n})\n    .search()\n    .then(result => {\n        result // {config, filepath}\n\n        result.config.default // if config uses `export default`\n    });\n```\n\n## Version correlation\n\n- lilconig v1 → cosmiconfig v6\n- lilconig v2 → cosmiconfig v7\n",
    "licenseText": "MIT License\n\nCopyright (c) 2022 Anton Kastritskiy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz",
    "hash": "78e23ac89ebb7e1bfbf25b18043de756548e7f52",
    "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==",
    "registry": "npm",
    "packageName": "lilconfig",
    "cacheIntegrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== sha1-eOI6yJ67fhv78lsYBD3nVlSOf1I="
  },
  "registry": "npm",
  "hash": "78e23ac89ebb7e1bfbf25b18043de756548e7f52"
}