# mesh-config

> Configuration microframework for Mesh IoC

Latest version **1.3.4** (published 2026-01-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install mesh-config
pnpm add mesh-config
yarn add mesh-config
bun add mesh-config
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.4 |
| Published | 2026-01-07 |
| First published | 2023-02-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Boris Okunskiy |
| Maintainers | inca |

## Links

- npm: https://www.npmjs.com/package/mesh-config
- Repository: https://github.com/MeshIoc/mesh-config
- Homepage: https://github.com/MeshIoc/mesh-config#readme
- Issues: https://github.com/MeshIoc/mesh-config/issues
- npm.io page: https://npm.io/package/mesh-config

## Recent versions

- 1.3.4 (latest) — 2026-01-07
- 1.3.3 — 2026-01-07
- 1.3.2 — 2026-01-06
- 1.3.1 — 2026-01-03
- 1.3.0 — 2025-12-29
- 1.2.4 — 2025-12-29
- 1.2.3 — 2025-12-29
- 1.2.2 — 2025-12-29
- 1.2.1 — 2024-12-22
- 1.2.0 — 2024-12-22
- 1.1.2 — 2024-04-19
- 1.1.1 — 2024-03-13
- 1.1.0 — 2023-07-27
- 1.0.0 — 2023-02-08

## README

# Configuration Microframework

Declarative configuration microframework for [Mesh IoC](https://github.com/MeshIoC/mesh-ioc).

## Highlights

- 🗜 Tidy and compact
- 💻 Works in browser
- 🔬 Strongly typed and introspectable
- 🌳 Ergonomic

## Usage

1. Define and use configs in your classes:

```ts
export class MyDatabase {
    @config() DATABASE_USERNAME!: string;
    @config() DATABASE_PASSWORD!: string;
    @config({ default: 10 }) DATABASE_MAX_CONNECTIONS!: number;

    async connect() {
        await this.db.connect({
            username: this.DATABASE_USERNAME,
            password: this.DATABASE_PASSWORD,
            maxConnections: this.DATABASE_MAX_CONNECTIONS,
        });
    }
}
```

2. Define `Config` provider in Mesh:

```ts
mesh.service(MyDatabase);
mesh.service(Config, ProcessEnvConfig);
```

3. Now `DATABASE_*` values will be read from `process.env`.

4. Enjoy!

---
_Source: https://npm.io/package/mesh-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
