Socket
Socket
Sign inDemoInstall

@coffeekraken/s-config-adapter

Package Overview
Dependencies
630
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @coffeekraken/s-config-adapter

Base class to use to create config adapters like the @coffeekraken/s-config-folder-adapter.


Version published
Maintainers
1
Created

Readme

Source

@coffeekraken/s-config-adapter

MIT 2.0.0-alpha.20 - Git repository

size downloads license discord

Base class to use to create config adapters like the @coffeekraken/s-config-folder-adapter.

Install

npm i @coffeekraken/s-config-adapter

SConfigAdapter

This package expose a simple SConfigAdapter class that has to be used as base when creating an SConfig adapter.

Features

  • Provide an update method to call when some configs has been changed.
  • And more...

Usage

Here's a simple example how to use the SConfigAdapter class:

import __SConfigAdapter from '@coffeekraken/s-config-adapter';
import type { ISConfigAdapterLoadParams } from '@coffeekraken/s-config-adapter';

class MyConfigAdapter extends __SConfigAdapter {
  constructor() {
    super({
      some: 'settings',
    });
    // listen for configuration change...
    myCoolLiteneingFunction(() => {
      // call the "update" method on the adapter
      this.update();
    });
  }
  async load(params: ISConfigAdapterLoadParams): Promise<any> {
    // load your configuration like you want....
    // return a simple configuration object
    return {
      my: 'config',
    };
  }
}
const myConfig = new __SConfig('my-config', new MyConfigAdapter());
myConfig.get('my'); // config

API

For more information about the API, please check out the API documentation

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Here's all the ways you can contact us listed:

discord email

FAQs

Last updated on 15 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc