{"_id":"@anandchowdhary/cosmic","_rev":"2-90e493aac4bd3fac18a6ee6c849dc64e","name":"@anandchowdhary/cosmic","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@anandchowdhary/cosmic","version":"1.0.0","description":"Find and load configuration for your app, based on cosmiconfig","main":"dist/index.js","bin":{"cosmic":"dist/index.js"},"types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","test-report":"jest --coverage --coverageReporters=text-lcov | coveralls","test-without-reporting":"jest --coverage","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/AnandChowdhary/cosmic.git"},"keywords":["node.js","typescript","javascript","library","cosmiconfig","config"],"author":{"name":"Anand Chowdhary","email":"mail@anandchowdhary.com"},"engines":{"node":">=10.0.0"},"license":"MIT","bugs":{"url":"https://github.com/AnandChowdhary/cosmic/issues"},"homepage":"https://anandchowdhary.github.io/cosmic/","dependencies":{"cosmiconfig":"^6.0.0","dotenv":"^8.2.0","lodash.camelcase":"^4.3.0"},"devDependencies":{"@semantic-release/git":"^9.0.0","@types/jest":"^26.0.8","@types/lodash.camelcase":"^4.3.6","@types/node":"^14.0.27","coveralls":"^3.1.0","jest":"^26.2.1","semantic-release":"^17.1.1","semantic-release-gitmoji":"^1.3.4","ts-jest":"^26.1.4","typescript":"^3.9.7"},"jest":{"roots":["<rootDir>"],"transform":{"^.+\\.tsx?$":"ts-jest"},"moduleFileExtensions":["js","ts","json"]},"gitHead":"35f0020334a1dbfa1e9e66176440e75b2f213205","_id":"@anandchowdhary/cosmic@1.0.0","_nodeVersion":"14.5.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-tVGSk+Ol4R5ZVXRUuCpsEEP6mpTaMdMzeyloRaoMmD3KBMUts5ZnRgcRu8dguOj7+dpkaJdreW3N+ciSRcwiyw==","shasum":"fdb5ac9d19bc8d6074769e8e1703ad20787a27e7","tarball":"https://registry.npmjs.org/@anandchowdhary/cosmic/-/cosmic-1.0.0.tgz","fileCount":6,"unpackedSize":10616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfI/U9CRA9TVsSAnZWagAA7sUP/2CNCYgY06KylbH8/CvU\nIlBVUqhtopp3QcowwGbJY08NaI3YUK7ydG5XLYpEpIDOtkXwTFUP0o/8WH/L\npdYlzzawtTpCKpQjG10FHixUkt7BR2PpLYhRr4+l9xQIYcOn8/5tvVIvLqGg\nHbWzbjgy+cWo6ICg+2tQOREBQFxNyAFWHZWBSxATOATFsQJViVCnKO4fwJUR\nE0Md2xHGlBTbf0SphdQ+3TSASMMI7vwpe4yqwz/aAB16X2v1pJtu4z5lnkBO\nBxaiDN3WJ3DeLyC2dqaAaJW07l3ZglPexq+NDSqKWWGpPJfDihhwzssROReK\npIpNWtVaxFMQgftUZhhoeU3L1t3jv88+5SDKtPser5F1N9GnlWsP7whWoqPT\nEdOBVfamEtlm4rA7uZ6jMZMAaT0nEKzsN3c8aVfzDQpCKWN1UNB8oW2Q0rR1\nQFJOWIrwz1vi/qLxK8fFFaKmqaV7+1+VL90A99NSQc6VE2K6+sAIqkZ+EBrg\nXEueuwcVdzFt/2GQfaTZg+iPw6Cye8Z157p3cNHeuUEDLOSmYLSIRvddtu6s\n2TpEB5lEbIDGALLkdWQwOtPFazgPQoA02OwZ89sF7ymqKxsyd6mnwcNM8yaY\nvhTJR71J+ywJg7Tonq9ETYPOh5XjkW85n1Omv5efWG2iIP5TqGpDhw6a4qcX\n7C/w\r\n=7/op\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpvJyIqqoHZXMi6t0+dYD7Wd5LLKT98vG0QAJaaL8/0wIgRd6T/JbGzBOV1Tkvx1Gspu9MKsKzeDLt7g1tscBhouM="}]},"maintainers":[{"name":"anandchowdhary","email":"npm@anandchowdhary.com"}],"_npmUser":{"name":"anandchowdhary","email":"npm@anandchowdhary.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cosmic_1.0.0_1596192061024_0.3540353035988939"},"_hasShrinkwrap":false},"1.0.1":{"name":"@anandchowdhary/cosmic","version":"1.0.1","description":"Find and load configuration for your app, based on cosmiconfig","main":"dist/index.js","bin":{"cosmic":"dist/index.js"},"types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","test-report":"jest --coverage --coverageReporters=text-lcov | coveralls","test-without-reporting":"jest --coverage","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/AnandChowdhary/cosmic.git"},"keywords":["node.js","typescript","javascript","library","cosmiconfig","config"],"author":{"name":"Anand Chowdhary","email":"mail@anandchowdhary.com"},"engines":{"node":">=10.0.0"},"license":"MIT","bugs":{"url":"https://github.com/AnandChowdhary/cosmic/issues"},"homepage":"https://anandchowdhary.github.io/cosmic/","dependencies":{"cosmiconfig":"^6.0.0","dotenv":"^8.2.0","lodash.camelcase":"^4.3.0"},"devDependencies":{"@semantic-release/git":"^9.0.0","@types/jest":"^26.0.8","@types/lodash.camelcase":"^4.3.6","@types/node":"^14.0.27","coveralls":"^3.1.0","jest":"^26.2.1","semantic-release":"^17.1.1","semantic-release-gitmoji":"^1.3.4","ts-jest":"^26.1.4","typescript":"^3.9.7"},"jest":{"roots":["<rootDir>"],"transform":{"^.+\\.tsx?$":"ts-jest"},"moduleFileExtensions":["js","ts","json"]},"gitHead":"a1edd119d1175111f46ad6bd2e200c7d95868b26","_id":"@anandchowdhary/cosmic@1.0.1","_nodeVersion":"12.18.3","_npmVersion":"6.14.7","dist":{"integrity":"sha512-faM5jhW9Ta2cvZMKaxFuuL+ZMrq9dnXylaj6VEFrHax/zCukkGO5eqbEJK5TjdtV/ZuCst/0OF22ZtP7GLEKDg==","shasum":"1036b873dbc52b1891837abf0d9220c3d416950d","tarball":"https://registry.npmjs.org/@anandchowdhary/cosmic/-/cosmic-1.0.1.tgz","fileCount":6,"unpackedSize":10725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV49FCRA9TVsSAnZWagAA4ewP/RlWPfmlQgi/KNOhi9jZ\nzpoUTI7w3jAt20Y2xjIV9CYfoVUfpmESdMr14uvuHavX/9OKn2Oufefb/J1s\ncPTdsamEQdpKE19ROC6sPo3SbgUJzivHtXCNOh8/SXk9ELyjNeV5ixrNqKFr\nwTl8EDrSe+VFPy6D5oZ++M8cxbYHlCGVOjG4AkttRwrI7K6dpF6N36pOdnD4\njBi5eRycEniK1NtshgJl/kfDkTrR4EpKkYJLK07jO3evuf4kjAlVoRuoWXug\nQ7xRzf9G38JQ+sgLAYooORmZzzmH5DT14VeUZC8CvtLOK0bXumjcN33m6fmA\nzoRb5dwvFGQ3btcZ3GALjzh4cxLswHl+n7YC0al2RR2ObbYDNEajMDLSAZYk\nChCb4H8GjdwMqOMuUaBqZjQ6Xko5Vhd5ZLE+brlhnti5L18EtaRgKAkhC2wx\nbLVz0BFiaHAzOKRmLdox58daHQ7Cbn2GICNOMwCGev7F8tEziIbPGdTAbHN8\n3jT2/SgihLz4seuhkj8nTXgYdE0V0ICmlGooRLoyZtfR+AtRVV/RUmG1V3IP\nWd2M2VQ5mM6SVEvZKlh8tlYRmYPLpPZqTNk5vk2eRtKp7qLBqg/ePffDV4vn\n8SmnftpzIXP7KHkLm0CCt5tHdJuRZpYWJmqeOnoXnPVYKz4rp5RYOLdNICBw\nBJ+b\r\n=hwDn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqhdRVeYPQOaDjqEZYIwIArzfxRUBFlqfbe9lSPbiwygIgf9pPgswbyHU/7O/YNK6k5RdvbA66vvfKqqqETN6iCEI="}]},"maintainers":[{"name":"anandchowdhary","email":"npm@anandchowdhary.com"}],"_npmUser":{"name":"anandchowdhary","email":"npm@anandchowdhary.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cosmic_1.0.1_1599573828532_0.5837699472364424"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-31T10:41:00.985Z","1.0.0":"2020-07-31T10:41:01.132Z","modified":"2022-04-04T13:55:13.826Z","1.0.1":"2020-09-08T14:03:48.647Z"},"maintainers":[{"name":"anandchowdhary","email":"npm@anandchowdhary.com"}],"description":"Find and load configuration for your app, based on cosmiconfig","homepage":"https://anandchowdhary.github.io/cosmic/","keywords":["node.js","typescript","javascript","library","cosmiconfig","config"],"repository":{"type":"git","url":"git+https://github.com/AnandChowdhary/cosmic.git"},"author":{"name":"Anand Chowdhary","email":"mail@anandchowdhary.com"},"bugs":{"url":"https://github.com/AnandChowdhary/cosmic/issues"},"license":"MIT","readme":"# 🌌 Cosmic\n\nFind and load configuration for your app, based on [cosmiconfig](https://github.com/davidtheclark/cosmiconfig#explorersearch), with fallback to environment variables.\n\n[![Node CI](https://img.shields.io/github/workflow/status/AnandChowdhary/cosmic/Node%20CI?label=GitHub%20CI&logo=github)](https://github.com/AnandChowdhary/cosmic/actions)\n[![Travis CI](https://img.shields.io/travis/AnandChowdhary/cosmic?label=Travis%20CI&logo=travis%20ci&logoColor=%23fff)](https://travis-ci.org/AnandChowdhary/cosmic)\n[![Coverage](https://coveralls.io/repos/github/AnandChowdhary/cosmic/badge.svg?branch=master&v=2)](https://coveralls.io/github/AnandChowdhary/cosmic?branch=master)\n[![Dependencies](https://img.shields.io/librariesio/release/npm/@anandchowdhary/cosmic)](https://libraries.io/npm/@anandchowdhary%2Fcosmic)\n[![License](https://img.shields.io/npm/l/@anandchowdhary/cosmic)](https://github.com/AnandChowdhary/cosmic/blob/master/LICENSE)\n[![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/@anandchowdhary/cosmic.svg)](https://snyk.io/test/npm/@anandchowdhary/cosmic)\n[![Based on Node.ts](https://img.shields.io/badge/based%20on-node.ts-brightgreen)](https://github.com/AnandChowdhary/node.ts)\n[![npm type definitions](https://img.shields.io/npm/types/@anandchowdhary/cosmic.svg)](https://unpkg.com/browse/@anandchowdhary/cosmic/dist/index.d.ts)\n[![npm package](https://img.shields.io/npm/v/@anandchowdhary/cosmic.svg)](https://www.npmjs.com/package/node.ts)\n[![npm downloads](https://img.shields.io/npm/dw/@anandchowdhary/cosmic)](https://www.npmjs.com/package/node.ts)\n[![Contributors](https://img.shields.io/github/contributors/AnandChowdhary/cosmic)](https://github.com/AnandChowdhary/cosmic/graphs/contributors)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n[![npm](https://nodei.co/npm/@anandchowdhary/cosmic.png)](https://www.npmjs.com/package/@anandchowdhary/cosmic)\n\n## ⭐ Features\n\nCosmic, like [cosmiconfig](https://github.com/davidtheclark/cosmiconfig#explorersearch), will look for a configuration file:\n\n- a `package.json` property\n- a JSON or YAML, extensionless \"rc file\"\n- an \"rc file\" with the extensions .json, .yaml, .yml, or .js.\n- a .config.js CommonJS module\n\nFor example, if the app name is \"cosmic\", these files will be searched:\n\n- a cosmic property in `package.json`\n- a `.cosmicrc` file in JSON or YAML format\n- a `.cosmicrc.json` file\n- a `.cosmicrc.yaml`, `.cosmicrc.yml`, or `.cosmicrc.js` file\n- a `cosmic.config.js` file exporting a JS object\n\nApart from these, it also looks for:\n\n- a `cosmic.yaml`, `cosmic.yml`, or `cosmic.js` file without \"rc\"\n- Environment variables\n\n## 💡 Usage\n\nInstall the package from [npm](https://www.npmjs.com/package/@anandchowdhary/cosmic):\n\n```bash\nnpm install @anandchowdhary/cosmic\n```\n\nImport and use:\n\n```ts\nimport { cosmic } from \"@anandchowdhary/cosmic\";\n\nconst config = await cosmic(\"project\"); // {}\n```\n\nUse the `config` function to fetch a value:\n\n```ts\nimport { cosmic, config } from \"@anandchowdhary/cosmic\";\n\nawait cosmic(\"project\");\nconst environment = config(\"nodeEnv\");\n```\n\nClear the cache and fetch configuration available:\n\n```ts\nimport { clearCosmicCache } from \"@anandchowdhary/cosmic\";\n\nclearCosmicCache();\n```\n\nSync functions are also available:\n\n```ts\nimport { cosmicSync } from \"@anandchowdhary/cosmic\";\n\nconst config = cosmicSync(\"project\"); // {}\n```\n\n## 👩‍💻 Development\n\nBuild TypeScript:\n\n```bash\nnpm run build\n```\n\nRun unit tests and view coverage:\n\n```bash\nnpm run test-without-reporting\n```\n\n## 📄 License\n\n[MIT](./LICENSE) © [Anand Chowdhary](https://anandchowdhary.com)\n","readmeFilename":"README.md"}