# @willsoto/node-konfig-core

> Core configuration pacakge supporting file, static and environment variables

Latest version **7.0.0** (published 2026-11-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @willsoto/node-konfig-core
pnpm add @willsoto/node-konfig-core
yarn add @willsoto/node-konfig-core
bun add @willsoto/node-konfig-core
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2026-11-01 |
| First published | 2020-11-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=24 |
| Dependencies | 1 |
| Unpacked size | 47 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 10 |
| Author | Will Soto <willsoto@users.noreply.github.com> (https://github.com/willsoto) |
| Maintainers | paradox41 |
| Keywords | config, configuration, configuration-management, json, toml, yaml |

## Links

- npm: https://www.npmjs.com/package/@willsoto/node-konfig-core
- Repository: https://github.com/willsoto/node-konfig
- npm.io page: https://npm.io/package/@willsoto/node-konfig-core

## Dependencies (1)

- [cockatiel](https://npm.io/package/cockatiel.md) 4.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 7.0.0 (latest) — 2026-11-01
- 6.0.0 — 2026-04-05
- 5.0.0 — 2022-08-20
- 4.1.0 — 2022-07-31
- 4.0.1 — 2021-10-24
- 4.0.0 — 2021-08-17
- 3.0.0 — 2021-08-16
- 2.2.1 — 2021-05-11
- 2.2.0 — 2021-04-21
- 2.1.0 — 2021-04-12
- 2.0.1 — 2021-04-11
- 2.0.0 — 2021-04-08
- 1.0.0 — 2021-04-06
- 0.3.1 — 2021-01-30
- 0.3.0 — 2021-01-11
- … 4 more at https://npm.io/package/@willsoto/node-konfig-core/versions

## README

# Node Konfig

> Thanks to [Konfig](https://github.com/lalamove/konfig) for the inspiration. This library would not have been possible without it.

Documentation is available at [https://willsoto.github.io/node-konfig/](https://willsoto.github.io/node-konfig/)

## Installation

```bash
npm install @willsoto/node-konfig-core
```

```bash
yarn add @willsoto/node-konfig-core
```

```bash
bun add @willsoto/node-konfig-core
```

## Quick look

```jsonc
// configs/development.json
{
  "name": "my-app",
  "database": {
    "host": "localhost",
    "port": 5432,
  },
}
```

```javascript
import * as Konfig from "@willsoto/node-konfig-core";
import path from "node:path";

// Create the store, this is the object you will use to access your config
export const store = new Konfig.Store();

// This will load configuration from the specified files. A parser must be provided
// so the loader knows how to interpret the file.
// Files are loaded in order, so any conflicts will be resolved through a "last one wins" approach.
// In this case, `local.json` will override properties that exist in both configurations.
const loader = new Konfig.FileLoader({
  files: [
    {
      path: path.join(process.cwd(), "configs", "development.json"),
      // This will tell the loader how it should interpret the files it loads
      parser: parser,
    },
    {
      path: path.join(process.cwd(), "configs", "local.json"),
      // This will tell the loader how it should interpret the files it loads
      parser: parser,
    },
  ],
});

// Make sure the loader is registered on the store in order for it to be processed.
store.registerLoader(loader);

// `init` must be called in order to actually resolve and process all the registered loaders
// This only needs to be called once at some point during application startup.
await store.init();

const databaseConfig = store.get("database");

console.log(databaseConfig);
// {
//   "host": "localhost",
//   "port": 5432
// }
```

---
_Source: https://npm.io/package/@willsoto/node-konfig-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
