# modreal-config

> This is an opinionated simple configuration package. It assumes:

Latest version **0.0.3** (published 2013-11-06) · 0 weekly downloads

## Install

```sh
npm install modreal-config
pnpm add modreal-config
yarn add modreal-config
bun add modreal-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.3 |
| Published | 2013-11-06 |
| First published | 2013-11-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aj0strow |

## Links

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

## Recent versions

- 0.0.3 (latest) — 2013-11-06

## README

# modreal-config

This is an opinionated simple configuration package. It assumes:

- configuraiton is a config folder with json files 
- the name of the json file is the name of the configuration
- NODE_ENV is used for the app environment
- test defaults to development, staging defaults to production
- if no environment is specified, it is for all environments

### How To Use

Add to your package as a dependency:

```
"dependencies": {
  "modreal-config": "modreal/config"
}
```

Install it:

```
$ npm install
```

Require it:

```
// javascript
var config = require("modreal-config");
```

```
# coffeescript
config = require 'modreal-config'
```

Access your configuraiton:

```
console.log(config.facebook)
```

See the next section for where to put your config json. 


### Config Folder Location

The config folder must be in the same directory or a parent directory of your main script file. Here are some examples of working folder setups:

```
+ package.json
- config
+ main.js
```

```
+ package.json
- config
- lib
  + main.js
```

```
+ package.json
- lib
  - config
  + main.js
```

### Example JSON Files

`mongo.json`

```
{
  "production": "mongodb://alweof8a:893fhalw8efla389fhaw9efgaw@82.154.4.14:1472/app_production",
  "staging": "mongodb://alweof8a:893fhalw8efla389fhaw9efgaw@82.154.4.14:1472/app_staging",
  "development": "mongodb://localhost:27017/app_development",
  "test": "mongodb://localhost:27017/app_test"
}
```

Would then be available at:

```
console.log(process.env.NODE_ENV)
// development

config = require('modreal-config')
console.log(config.mongo)
// mongodb://localhost:27017/app_development
```

### License

MIT

---

AJ Ostrow, November 2013

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