# g2-ops-config

### Goal

Centralized support for Cloud Config for Copart

### API

1.  Standard API

```js
import fetchConfigurations from 'g2-ops-config'

fetchConfigurations(APPLICATION, [PROFILE1, PROFILE2]).then((response) => console.log(response))

// Will Print
{
  [PROFILE1]: {}, // configurations for PROFILE1
  [PROFILE2]: {} // configurations for PROFILE1
}
```

2.  We will inject configurations into process when configuration begins with `ENV-`

```yaml
// application.yaml
ENV:
  SESSION_ID = 'secret'
  BABEL_ENV = 'development'
```

```js
import fetchConfigurations from 'g2-ops-config'

fetchConfigurations(APPLICATION, [PROFILE1, PROFILE2]).then((response) => console.log(response))

// Will Print
{
  [PROFILE1]: {}, // configurations for PROFILE1
  [PROFILE2]: {} // configurations for PROFILE1
}

// And also things are available on process
console.log(process.env.SESSION_ID) // should print 'secret'
console.log(process.env.BABEL_ENV) // should print 'development'
```

### ISSUES

Please, report issues at: [g2-ops-config](https://github.com/copartit/g2-ops-config/issues)
