# @openally/config

> Reactive configuration loader

Latest version **2.1.0** (published 2026-09-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2026-09-20 |
| First published | 2024-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 3 |
| Unpacked size | 54.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | GENTILHOMME Thomas |
| Maintainers | fraxken, pierred |
| Keywords | openally, config, json, schema, safe, loader, observable, reactive, hotreload |

## Links

- npm: https://www.npmjs.com/package/@openally/config
- Repository: https://github.com/OpenAlly/npm-packages
- Homepage: https://github.com/OpenAlly/npm-packages#readme
- Issues: https://github.com/OpenAlly/npm-packages/issues
- npm.io page: https://npm.io/package/@openally/config

## Dependencies (3)

- [ajv](https://npm.io/package/ajv.md) ^8.17.1
- [smol-toml](https://npm.io/package/smol-toml.md) ^1.2.2
- [zen-observable](https://npm.io/package/zen-observable.md) ^0.10.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

- 2.1.0 (latest) — 2026-09-20
- 2.0.0 — 2026-07-29
- 1.2.0 — 2025-10-04
- 1.1.0 — 2025-06-24
- 1.0.1 — 2024-07-29
- 1.0.0 — 2024-07-28

## README

<p align="center"><h1 align="center">
  Config
</h1>

<p align="center">
  Reactive configuration loader with safe hot reload configuration upon <a href="https://json-schema.org/" target="_blank">JSON Schema</a>
</p>

## Requirements
- [Node.js](https://nodejs.org/en/) v24 or higher

## Getting Started

This package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).

```bash
$ npm i @openally/config
# or
$ yarn add @openally/config
```

## Features

- Hot-reloading of configuration
- Reactive with observable key(s)
- Safe with [JSON Schema](https://json-schema.org/) validation
- Support [TOML](https://github.com/toml-lang/toml) as input (enable the parser when the file extension end with **.toml**)
- Read configuration with no extension that start with a dot (like `.nodesecurerc` for example).


## Usage example

Create a simple json file for your project

```json
{
  "loglevel": 5,
  "logsize": 4048,
  "login": "administrator"
}
```

Now, create a new Configuration instance and read it

```js
import { AsynchronousConfig } from "@openally/config";

const config = new AsynchronousConfig("./path/to/config.json");
await config.read();
console.log(cfg.get("loglevel")); // stdout: 5

// Observe (with an Observable Like) the update made to login property
config.observableOf("login").subscribe(console.log);
config.set("login", "admin");

// Payload getter will return a deepClone with all configuration properties
console.log(config.payload);

config.close();
```

> [!IMPORTANT]
> `config.json` should exists otherwise it will throw an Error. Look at `createOnNoEntry` option for more information !

## API

- [AsynchronousConfig](./docs/AsynchronousConfig.md)
- [SynchronousConfig](./docs/SynchronousConfig.md)

## License
MIT

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