# cosmiconfig/cosmiconfig

Find and load configuration from a package.json property, rc file, TypeScript module, and more!

Repository: https://github.com/cosmiconfig/cosmiconfig
Canonical: https://ross.abutalabs.com/products/cosmiconfig
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2026-08-02T10:57:43+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 40, longevity 100
- inputs: {"age_days": 3952, "days_push": 31, "days_rel": 184, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4157, forks 143 (observed 2026-08-28T04:08:36.593888+00:00)

## What it is
Cosmiconfig is a Node.js library that searches for and loads configuration files for JavaScript tools and applications. It supports conventional locations like package.json properties, rc files, and JS/TS config modules, with flexible search strategies and caching.

## Use cases
- load configuration from package.json property
- find and load rc files for a CLI tool
- support multiple config file formats (json, yaml, js, ts)
- search up the directory tree for a config file
- add configurable settings to a JavaScript library
- load TypeScript config modules

## When to choose
- you're building an npm tool or library that needs user configuration
- you want to support the standard JS ecosystem config conventions out of the box
- you need flexible config file discovery with caching

## When to avoid
- you need environment-variable-only configuration
- you're not in the Node.js/JavaScript ecosystem
- you need a full config validation schema system (combine with a validator instead)

## Facets
- artifact type: library
- maturity: stable
- function: configuration-management, parser, developer-tools
- domain: developer-tools, web-development, backend
- platform: cross-platform
- tags: config-loading, rc-files, package-json, config-discovery, javascript-tooling, npm, automation, nodejs, javascript, typescript

## Member repositories
- cosmiconfig/cosmiconfig (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:36.593888+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:51.286313+00:00, confidence not recorded.
  - readme: https://github.com/cosmiconfig/cosmiconfig (fetched 2026-08-28T04:08:36.593888+00:00, sha c749ad54ad7c)
  - registry_npm: https://registry.npmjs.org/cosmiconfig (fetched 2026-08-29T09:13:54.177666+00:00, sha 57f57f47a33e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
