@jswork/hot-config-service
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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.

/@jswork/hot-config-service/

    Package Sidebar

    Install

    npm i @jswork/hot-config-service

    Weekly Downloads

    0

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    21.3 kB

    Total Files

    10

    Last publish

    Collaborators

    • afeiship