cosmiconfig
npmv9.0.2TypeScriptFind and load configuration from a package.json property, rc file, TypeScript module, and more!
Overview
cosmiconfig is an npm package that find and load configuration from a package.json property, rc file, TypeScript module, and more!. It is extremely widely used, with about 120.7M downloads per week and 2 known dependents in the graph. The latest version is 9.0.2, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need find and load configuration from a package.json property, rc file, TypeScript module, and more! and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (120.7M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- Large dependency tree (26 direct dependencies) increases install size and audit surface.
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of cosmiconfig.
Dependencies
Runtime (4)
Peer (1)
Dev (21)
Used by
Popular packages that depend on cosmiconfig.
Alternatives to cosmiconfig
Get and typecast environment variables.
Strip comments from JSON. Lets you use comments in your JSON files!
Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST
General purpose glob-based configuration matching.
Get paths for storing things like data, config, cache, etc
Metro configuration for React Native.
test for inclusion or exclusion of paths using globs
Frequently installed together
The semantic version parser used by npm.
TypeScript definitions for node
resolve like require.resolve() on behalf of files asynchronously and synchronously
It's a very fast and efficient glob library for Node.js
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
A high-level API to automate web browsers
Bare bones Promises/A+ implementation
Object schema validation
No description provided.
No description provided.
Make a directory and its parents if needed - Think `mkdir -p`
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
Version history
| Version | Published | License |
|---|---|---|
| 10.0.0-alpha.0 | 1 month ago | MIT |
| 9.0.2latest | 1 month ago | MIT |
| 9.0.1 | 4 months ago | MIT |
| 9.0.0 | 2 years ago | MIT |
| 9.0.0-alpha.3 | 2 years ago | MIT |
| 9.0.0-alpha.2 | 2 years ago | MIT |
| 9.0.0-alpha.1 | 2 years ago | MIT |
| 9.0.0-alpha.0 | 2 years ago | MIT |
| 8.3.6 | 2 years ago | MIT |
| 8.3.5 | 2 years ago | MIT |
| 8.3.4 | 2 years ago | MIT |
| 8.3.3 | 2 years ago | MIT |
| 8.3.2 | 2 years ago | MIT |
| 8.3.1 | 2 years ago | MIT |
| 8.3.0 | 2 years ago | MIT |
| 8.2.0 | 3 years ago | MIT |
| 8.1.3 | 3 years ago | MIT |
| 8.1.2 | 3 years ago | MIT |
| 8.1.1 | 3 years ago | MIT |
| 8.1.0 | 3 years ago | MIT |
Maintainers
Keywords
Funding
Frequently asked questions
How do I install cosmiconfig?
Run `npm install cosmiconfig` to add cosmiconfig to your npm project.
What license is cosmiconfig released under?
cosmiconfig is distributed under the MIT license.
How popular is cosmiconfig?
cosmiconfig has approximately 120,726,886 downloads per week and 2 known dependent packages.