# coelacanth

> Derivation based config management with defaults and overrides

Latest version **0.2.2** (published 2017-05-24) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install coelacanth
pnpm add coelacanth
yarn add coelacanth
bun add coelacanth
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2017-05-24 |
| First published | 2017-05-24 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Abhinav Tushar |
| Maintainers | lepisma |

## Links

- npm: https://www.npmjs.com/package/coelacanth
- Repository: https://github.com/lepisma/coelacanth
- Homepage: https://github.com/lepisma/coelacanth#readme
- Issues: https://github.com/lepisma/coelacanth/issues
- npm.io page: https://npm.io/package/coelacanth

## Recent versions

- 0.2.2 (latest) — 2017-05-24
- 0.2.1 — 2017-05-24
- 0.1.1 — 2017-05-24

## README

# coelacanth

[![Build Status](https://img.shields.io/travis/lepisma/coelacanth.svg?style=flat-square)](https://travis-ci.org/lepisma/coelacanth)
[![npm](https://img.shields.io/npm/v/coelacanth.svg?style=flat-square)](https://www.npmjs.com/package/coelacanth)
[![npm](https://img.shields.io/npm/l/coelacanth.svg?style=flat-square)](https://www.npmjs.com/package/coelacanth)
[![GitHub issues](https://img.shields.io/github/issues/lepisma/coelacanth.svg?style=flat-square)](https://github.com/lepisma/coelacanth/issues)


Derivation based config management with defaults and overrides.

#### The problem

> You want a config object with certain *defaults* and some reactive *derived*
> key-value pairs. *Overrides* to any of these values should take precedence.

```js
import Coelacanth from 'coelacanth'

const configData = {
  x: 40,
  y: 32,
  margins: {
    top: 10
  }
}

let conf = new Coelacanth(configData)
conf.x // 40

conf.margins.derive('bottom', (node, root) => node.top + root.x)
conf.margins.bottom // 50

conf = conf.overwrite({margins: {top: 30}})
conf.margins.bottom // 70
```

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