@3xpo/conf
TypeScript icon, indicating that this package has built-in type declarations

0.2.13 • Public • Published

@3xpo/conf

A Micro Configuration Library. You're most likely better off writing your own library than adding this to your supply chain; I mainly made this as a small utility for myself.

Overview

@3xpo/conf is a micro configuration library designed for simplicity, minimalism and ease of use. It provides a lightweight solution for managing configurations in your projects.

Installation

Install the library using your preferred package manager:

pnpm i @3xpo/conf

Usage

Getting Started

To start using @3xpo/conf, import the library and create an instance of the Config class:

import Config from '@3xpo/conf';

const defaultConfig = {
  someConfig: 'hi',
};

export class YourClass {
  public config = new Config(defaultConfig);
}

export default YourClass;

Changing Configuration Values

const yourClass = new YourClass();
yourClass.config.get('someConfig'); // => 'hi'
yourClass.config.set('someConfig', 'hello!');
yourClass.config.get('someConfig'); // => 'hello!'
yourClass.config.reset(); // you can also pass a key here to ONLY reset that one key
yourClass.config.get('someConfig'); // => 'hi'

Readme

Keywords

none

Package Sidebar

Install

npm i @3xpo/conf

Weekly Downloads

52

Version

0.2.13

License

MIT

Unpacked Size

22.7 kB

Total Files

11

Last publish

Collaborators

  • exponentialworkload