# cocobag

> configuration manager for hapi based on nconf

Latest version **1.0.1** (published 2016-08-18) · GPL-3.0 license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2016-08-18 |
| First published | 2016-08-18 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | "Nicolas Dufreche |
| Maintainers | ndufreche |
| Keywords | Config, nconf, hapi, server |

## Links

- npm: https://www.npmjs.com/package/cocobag
- Repository: https://github.com/hapipip/cocobag
- Homepage: https://github.com/hapipip/cocobag#readme
- Issues: https://github.com/hapipip/cocobag/issues
- npm.io page: https://npm.io/package/cocobag

## Dependencies (3)

- [joi](https://npm.io/package/joi.md) ^9.0.4
- [nconf](https://npm.io/package/nconf.md) ^0.8.4
- [pellmell](https://npm.io/package/pellmell.md) ^1.0.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

- 1.0.1 (latest) — 2016-08-18
- 1.0.0 — 2016-08-18

## README

![cocobag Logo](https://raw.github.com/hapipip/cocobag/master/images/cocobag.png)

# Cocobag

[![Build Status](https://travis-ci.org/hapipip/cocobag.svg)](https://travis-ci.org/hapipip/cocobag)

### Cocobag aggregate all config files.

Cocobag expose "bag" variable who is a [nconf object](https://github.com/indexzero/nconf) into hapi server. It supports YAML, JSON, JS modules and folder.

### Installation

```js
npm install cocobag --save
```

### Initialization

```js
const Hapi = require('hapi');
const Path = require('path');

server = new Hapi.Server();
server.connection();

server.register({
  register: require('cocobag'),
  options: {
    defaults: [ // the defaults configurations
      Path.join(__dirname, 'default'),
      Path.join(__dirname, 'default2')
    ],
    paths: [ // your environment configurations
      Path.join(__dirname, 'environment')
    ]
  }
}, (err) => {
  if (err) {
    throw err
  }
  // now you can access to the bag variable.
  server.bag.get('my:config:variable')
})
```

### Interface

See nconf's [API](https://github.com/indexzero/nconf#example).

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