# super-config

> A light-weight config for Node

Latest version **0.0.8** (published 2015-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install super-config
pnpm add super-config
yarn add super-config
bun add super-config
```

## 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.0.8 |
| Published | 2015-02-19 |
| First published | 2014-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Alvares |
| Maintainers | agencypmg |

## Links

- npm: https://www.npmjs.com/package/super-config
- Repository: https://github.com/AgencyPMG/node-super-config
- Issues: https://github.com/AgencyPMG/node-super-config/issues
- npm.io page: https://npm.io/package/super-config

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) ^1.7.0

## Recent versions

- 0.0.8 (latest) — 2015-02-19
- 0.0.7 — 2014-11-12
- 0.0.6 — 2014-11-10
- 0.0.4 — 2014-06-18

## README

Simple Node Config
===========
[![Build Status](https://travis-ci.org/AgencyPMG/node-super-config.svg?branch=master)](https://travis-ci.org/AgencyPMG/node-super-config) [![Coverage Status](https://coveralls.io/repos/AgencyPMG/node-super-config/badge.png?branch=master)](https://coveralls.io/r/AgencyPMG/node-super-config?branch=master)


This light-weight NodeJS package allows you to load your config files, as well as easily edit them with getters and setters. The files have to be in JSON format.

##Examples

###Loading Config Files
Store the `super-config` class in a variable and load as many configuration files as you have.
```
var config = require('super-config');

config.loadConfig([
    __dirname + '/app/config/config',
    __dirname + '/app/config/local'
]);
```
**It's that simple.**

### Example config file
```js
module.exports = {
    database: {
        host:'127.0.0.1',
        port:'27017',
        dbname:'example_DB'
    },
    someOtherSetting: 1234,
    name: 'myname'
}
```

###Getting Information
Let's pretend our config file contains this section of code:
```js
database: {
    host:'127.0.0.1',
    port:'27017',
    dbname:'example_DB'
}
```
It would pretty nice if we could easily retrieve that information right? Here's how-to:
```js
var host = config.get('database.host', '');
var port = config.get('database.port', '');
var dbName = config.get('database.dbname', '');
```
**It's that simple.**

###Setting Information
Need to set some information in the config object? Not a problem:
```js
config.set('database.host', 'mydbserver');
```

**Simple Config, it's THAT simple.**

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