API Reference

unconfig

Unified configuration loader supporting multiple sources, rc files, package.json, and environment with type-safe results.

Official Documentation ↗
CompatibilityThis documentation covers version v7.5.0. Check the official docs for the latest API surface.

Installation

npmnpm install unconfig

Methods

unconfig is unified configuration loader supporting multiple sources, rc files, package.json, and environment with type-safe results. This page documents the core methods, installation, and common usage patterns for the current stable release.

Installation

Install unconfig with your preferred package manager using the command shown in the frontmatter. The package is published to the npm registry and ships with TypeScript types where applicable.

Core methods

The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v3.0 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.

Frequently asked questions

The faq section in the frontmatter answers the most common questions about unconfig, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.

FAQ

Which rc files are supported?
.myapprc, .myapprc.json, .myapprc.yaml, .myapprc.js, and myapp.config.* by default.
Can I read from package.json?
Yes. Add { sources: { packageJson: { field: 'myapp' } } } to read a nested key.
How does it merge?
It uses defu for deep merge; later sources fill gaps in earlier ones.