# @capsulajs/capsulajs-configuration-service

> Capsula-JS Configuration Service

Latest version **0.1.17** (published 2022-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @capsulajs/capsulajs-configuration-service
pnpm add @capsulajs/capsulajs-configuration-service
yarn add @capsulajs/capsulajs-configuration-service
bun add @capsulajs/capsulajs-configuration-service
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.17 |
| Published | 2022-05-16 |
| First published | 2019-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 144.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | CapsulaJS |
| Maintainers | idanilt, capsulajsci, mikesquall, 95kach, capsulajsbot |

## Links

- npm: https://www.npmjs.com/package/@capsulajs/capsulajs-configuration-service
- npm.io page: https://npm.io/package/@capsulajs/capsulajs-configuration-service

## Dependencies (2)

- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) ^3.6.2
- [@capsulajs/capsulajs-transport-providers](https://npm.io/package/@capsulajs/capsulajs-transport-providers.md) ^0.1.2

## Recent versions

- 0.1.17 (latest) — 2022-05-16
- 0.1.16 — 2019-11-22
- 0.1.15 — 2019-09-12
- 0.1.14 — 2019-07-25
- 0.1.13 — 2019-07-18
- 0.1.12 — 2019-06-21
- 0.1.11 — 2019-06-12
- 0.1.10 — 2019-06-12
- 0.1.9 — 2019-05-31
- 0.1.8 — 2019-05-15
- 0.1.7 — 2019-05-15
- 0.1.6 — 2019-04-03
- 0.1.5 — 2019-02-20
- 0.1.4 — 2019-02-20
- 0.1.3 — 2019-02-05
- … 3 more at https://npm.io/package/@capsulajs/capsulajs-configuration-service/versions

## README

# Configuration Service

## Providers

### localFile

Configuration will be included in a local json file.

_Example token: "./path/to/configuration"_

### httpFile

Configuration will be included in a json file on some external http/https host and will be served statically.

_Example token: "[http://localhost:1234](http://localhost:1234)"_

### scalecube

Configuration will be available as an entry point of a special Scalecube server.

### httpServer

Configuration will be available as an entry point of some http/https server.

_Example token: "[http://localhost:1234](http://localhost:1234)"_

### localStorage

Configuration will be available under a special key in localStorage.

_Example token: "configurationKey"_

## GetProvider util

Is used to get the class of an appropriate ConfigurationProvider.

Will throw an error, if wrong **configProvider** is provided in the call of the function.

Possible values for **configProvider**:
1. "localFile"
2. "httpFile"
3. "scalecube"
4. "httpServer"
5. "localStorage"

**Example**

```typescript
try {
  const HttpFileConfigurationProvider = getProvider({ configProvider: "localFile" as LocalFileConfigurationProvider });
  const configurationService = new HttpFileConfigurationProvider("http://localhost:1234");
} catch(error) {
  console.log('error.message');
}
```

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