# cnf

> Configuration loader

Latest version **3.3.3** (published 2019-09-26) · MIT license · 0 weekly downloads

## Install

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

## 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 | 3.3.3 |
| Published | 2019-09-26 |
| First published | 2014-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | debitoor |
| Maintainers | bifrost, bubenshchykov, eagleeye, ebdrup, fizker, jonatanpedersen, kapetan, mpushkin, wtfil |
| Keywords | configuration |

## Links

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

## Dependencies (2)

- [resolve](https://npm.io/package/resolve.md) 1.12.0
- [deep-extend](https://npm.io/package/deep-extend.md) 0.6.0

## 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

- 3.3.3 (latest) — 2019-09-26
- 3.3.2 — 2018-06-04
- 3.3.1 — 2016-10-14
- 3.3.0 — 2016-10-14
- 3.2.0 — 2016-10-14
- 3.0.1 — 2016-04-12
- 3.0.0 — 2015-12-11
- 2.2.1 — 2015-09-29
- 2.2.0 — 2015-03-30
- 2.1.6 — 2015-02-13
- 2.1.5 — 2015-02-12
- 2.1.3 — 2014-05-03
- 2.1.2 — 2014-05-03

## README

cnf [![npm version](https://badge.fury.io/js/cnf.svg)](http://badge.fury.io/js/cnf) [![Build Status](https://travis-ci.org/debitoor/cnf.svg?branch=master)](https://travis-ci.org/debitoor/cnf) [![Dependency Status](https://david-dm.org/debitoor/cnf.svg)](https://david-dm.org/debitoor/cnf) [![devDependency Status](https://david-dm.org/debitoor/cnf/dev-status.svg)](https://david-dm.org/debitoor/cnf#info=devDependencies)
===

Configuration loader.

	npm install -SE cnf 

To use it simply require it:

```js
var config = require('cnf');

console.log('port: ' + config.http.port);
```

It will look for a configuration file called `/config/$APP_ENV.js` in the current working directory and will be extended with config from `global.js`.

To override configs use a command line argument prefixed with `app.`

	node example.js --app.http.port 8080

The above line override `http.port` with `8080`

To refer to another part of the config use
```js
{
	port: 8080,
	siteUrl: "http://localhost:$(port)" //this will be "http://localhost:8080"
}
```

Add a regexp using
```
--app.mySetting "$regexp(/myRegExp/gmi)"
```

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