# deling

> Simple environment configuration for node

Latest version **1.0.0** (published 2015-09-04) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-09-04 |
| First published | 2015-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel Juhl |
| Maintainers | danieljuhl |
| Keywords | config, configs, configuration, settings, setting, environment |

## Links

- npm: https://www.npmjs.com/package/deling
- Repository: https://github.com/kodyl/deling
- Issues: https://github.com/kodyl/deling/issues
- npm.io page: https://npm.io/package/deling

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-09-04
- 1.0.0-beta — 2015-04-06
- 1.0.0-alpha — 2015-03-27

## README

# deling

Simple app-wide configuration. Based on a simply and pre-defined pattern files are read and merged into the configuration object, which is exposed directly from the module.

No need to configure `deling` before it works - simple `import` your `deling` (the Danish word for 'sharing' and for the military unit 'platoon').

## Install

`npm install --save deling`

## Configuration

You don't need to configure `deling`, but you have to configure your app - and that's what we are going to do.

## Usage

### Create configuration

`deling` will look in the root of your project (by traverse module.parent) for config files, either in a directory named `config` or directly in the root.  If the directory `config` exists `deling` will NOT be looking in the root for config files.

The content of each file will be merged into the config object, overwriting existing values for everything other than nested objects which will be deep merged.


```
# order of files in ./config
./config/default.{js,json}
./config/{NODE_ENV}.{js,json}
./config/local.{js,json}

# order of files ./
./config.{js,json}
./config.{NODE_ENV}.{js,json}
./config.local.{js,json}
```

### Default configuration

`deling` automatically adds some data about your project before merging in content from you config files.

```
{
  root: '/absolute/path/to/your/application',
  env: process.env.NODE_ENV || 'development',
  name: pkgJson.name || '',
  version: pkgJson.version || ''
}
```

### Access configuration

`var config = require('deling');` or the ES6 way `import config from 'deling';`

`config` is a reference to your combined config based on your current environment.

That's it... sorry if you hoped for more work - but `deling` is all about making configuration consitent and easy through out your application.

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