# fastify-rob-config

> Fastify Rob-Config integration

Latest version **1.1.0** (published 2020-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install fastify-rob-config
pnpm add fastify-rob-config
yarn add fastify-rob-config
bun add fastify-rob-config
```

## 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.1.0 |
| Published | 2020-09-22 |
| First published | 2018-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jérôme Macias |
| Maintainers | jeromemacias |

## Links

- npm: https://www.npmjs.com/package/fastify-rob-config
- Repository: https://github.com/jeromemacias/fastify-rob-config
- Homepage: https://github.com/jeromemacias/fastify-rob-config#readme
- Issues: https://github.com/jeromemacias/fastify-rob-config/issues
- npm.io page: https://npm.io/package/fastify-rob-config

## Dependencies (2)

- [rob-config](https://npm.io/package/rob-config.md) ^6.0.0
- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^1.6.0

## Recent versions

- 1.1.0 (latest) — 2020-09-22
- 1.0.0 — 2020-09-22
- 0.0.2 — 2018-02-13
- 0.0.1 — 2018-02-12

## README

# fastify-rob-config

Fastify Rob-Config integration

[![Current Version](https://img.shields.io/npm/v/fastify-rob-config.svg)](https://www.npmjs.com/package/fastify-rob-config)
[![Build Status](https://travis-ci.org/jeromemacias/fastify-rob-config.svg?branch=master)](https://travis-ci.org/jeromemacias/fastify-rob-config)

## Install
```
npm i fastify-rob-config
```
## Usage

First, initialize your configuration and schema file: https://github.com/jeromemacias/node-rob-config#rob-config

```js
const fastify = require('fastify')()
const fastifyRobConfig = require('fastify-rob-config')

const config = require('rob-config')
const options = {
  confKey: 'config', // optional, default: config
  asProperties: false, // if true, you will access to config.key instead of config.get('key'), default: false
  config: config // optional, default: require('rob-config')
}

fastify.register(fastifyRobConfig, options, function (err) {
   // or fastify[options.confKey].get('env')
  console.log(fastify.config.get('env'))
}))
```

### Credits

- [convict](https://github.com/mozilla/node-convict) Featureful configuration management library for Node.js

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