# @jil/config

> Powerful convention based finder, loader, and manager of both configuration and ignore files.

Latest version **0.4.0** (published 2023-12-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jil/config
pnpm add @jil/config
yarn add @jil/config
bun add @jil/config
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-12-30 |
| First published | 2022-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.19.0 |
| Dependencies | 7 |
| Unpacked size | 138 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | TY |
| Maintainers | towyuan |

## Links

- npm: https://www.npmjs.com/package/@jil/config
- npm.io page: https://npm.io/package/@jil/config

## Dependencies (7)

- [tily](https://npm.io/package/tily.md) ^2.22.8
- [minimatch](https://npm.io/package/minimatch.md) ^9.0.3
- [@jil/debug](https://npm.io/package/@jil/debug.md) ^0.3.0
- [@jil/common](https://npm.io/package/@jil/common.md) ^0.3.0
- [@jil/module](https://npm.io/package/@jil/module.md) ^0.3.0
- [@jil/ncommon](https://npm.io/package/@jil/ncommon.md) ^0.3.0
- [@jil/support](https://npm.io/package/@jil/support.md) ^0.3.0

## Recent versions

- 0.4.0 (latest) — 2023-12-30
- 0.3.18 — 2023-10-18
- 0.3.17 — 2023-06-09
- 0.3.16 — 2023-03-19
- 0.3.15 — 2023-02-08
- 0.3.14 — 2022-12-29
- 0.3.13 — 2022-12-23
- 0.3.12 — 2022-12-23
- 0.3.11 — 2022-10-26
- 0.3.10 — 2022-10-25
- 0.3.9 — 2022-09-20
- 0.3.8 — 2022-03-19
- 0.3.7 — 2022-03-13
- 0.3.6 — 2022-03-07
- 0.3.5 — 2022-03-03
- … 9 more at https://npm.io/package/@jil/config/versions

## README

# @jil/config

> Powerful convention based finder, loader, and manager of both configuration and ignore files.

```ts
import {Blueprint, Schemas} from '@jil/common/optimal';
import {Configuration} from '@jil/config';

interface ConfigFile {
  debug: boolean;
  sourceMaps: boolean;
}

class ConfigManager extends Configuration<ConfigFile> {
  blueprint({bool}: Schemas): Blueprint<ConfigFile> {
    return {
      debug: bool(),
      sourceMaps: bool(),
    };
  }
}

const configManager = new ConfigManager('jil');

// Load `.config/jil.js`, `jil.production.json`, `.jil.yaml`, etc
const {config} = await configManager.loadConfigFromRoot('.');

// Load `.jilignore` files
const ignore = await configManager.loadIgnoreFromBranchToRoot('./some/deep/path');
```

## Features

- Loads root configs (`.config/<name>.js`) and branch configs (`.<name>.js`).
- Loads ignore files (`.<name>ignore`).
- Supports multiple config types: `js`, `cjs`, `mjs`, `json`, `yaml`
- Supports environment and root-level based overrides.
- Supports extending from other config files.
- Find files within each branch folder while traversing up the tree.
- Caches finder results for increased efficiency.
- Custom key-value setting processors.

## Installation

```
npm i @jil/config
```

## Documentation

- [https://boostlib.dev/docs/config](https://boostlib.dev/docs/config)
- [https://boostlib.dev/api/config](https://boostlib.dev/api/config)

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