1.0.4 • Published 5 months ago

@jswork/hot-config-service v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

hot-config-service

A lightweight JavaScript class for dynamic configurations.

version license size download

installation

npm install @jswork/hot-config-service

usage

import HotConfigService from '@jswork/hot-config-service';

const hotConfig = new HotConfigService({
  envs: {
    'beta': 'https://student-api.beta.saybot.net',
    'production': 'https://student-api.alo7.com'
  },
  env: 'beta',
  subpath: '/api/v2/configurations/'
});

// setOptions
hotConfig.setOptions({ env: 'production' });

// fetch
await hotConfig.fetch();

// get value
hostConfig.get('env');

types

/// <reference types="@jswork/hot-config-service/global.d.ts" />

license

Code released under the MIT license.

1.0.4

5 months ago

1.0.3

5 months ago

1.0.1

5 months ago