# mumba-config

> Simple configuration manager.

Latest version **0.1.1** (published 2016-07-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install mumba-config
pnpm add mumba-config
yarn add mumba-config
bun add mumba-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.1.1 |
| Published | 2016-07-15 |
| First published | 2016-07-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=0.12 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mumba Pty Ltd |
| Maintainers | mumbacloud |
| Keywords | config, configuration, key value store |

## Links

- npm: https://www.npmjs.com/package/mumba-config
- Repository: https://gitlab.com/Mumba/node-config
- Homepage: https://gitlab.com/Mumba/node-config#README
- Issues: https://gitlab.com/Mumba/node-config/issues
- npm.io page: https://npm.io/package/mumba-config

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

- 0.1.1 (latest) — 2016-07-15
- 0.1.0 — 2016-07-15

## README

# Mumba Config

A very simple configuration handler in the tradition of `nconf`.

## Installation

```sh
$ npm install mumba-config
```

## Examples

```typescript
import {Config} from "mumba-config";

let config = new Config({
  db: {
    user: 'user',
    pass: 'password'
  }
});

config.get();          // { db: { user: 'user', pass: 'password' } }
config.get('db');      // { user: 'user', pass: 'password' }
config.get('db:user'); // 'user'
config.get('db:pass'); // 'password'

config.set('log:level', 'silly');
```

Loading a file or directory

```typescript
import {Config, FileLoader, DirectoryLoader} from "mumba-config";

let config = new Config();

config.registerLoader(new FileLoader())
	.registerLoader(new DirectoryLoader());

config.load([{
		name: 'file',
		filePath: '/path/to/file.json'
	},
	{
		name: 'directory',
		dirPath: 'path/to/dir',
		exclude: 'local\.js'
	}])
	.then(() => {
		console.log(config.get())
	})
	.catch(console.error);
```

## Loaders

### File

Loads a JavaScript or JSON configuration file.

Parameter | Type | Description
--- | :---: | ---
`type` | `string` | **Required** Must be set to `file`.
`filePath` | `string` | **Required** The full path to the configuration file to load.

### Directory

Loads a directory of JavaScript or JSON files.

Parameter | Type | Description
--- | :---: | ---
`type` | `string` | **Required** Must be set to `file`.
`dirPath` | `string` | **Required** The full path to directory containing the configuration files.
`exclude` | `string` | An optional regular expression for files to exclude from the directory.

## Tests

To run the test suite, first install the dependencies, then run `npm test`:

```sh
$ npm install
$ npm test
```

## People

The original author of _Mumba Config_ is [Andrew Eddie](https://gitlab.com/u/aeddie.mumba).

## License

[Apache 2.0](LICENSE.txt)

* * *

&copy; 2016 [Mumba Pty Ltd](http://www.mumba.cloud). All rights reserved.

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