0.0.16 • Published 9 months ago

@novemberizing/config v0.0.16

Weekly downloads
-
License
MPL-2.0
Repository
gitlab
Last release
9 months ago

NOVEMBERIZING CONFIG

ENGLISH | 한국어

Node js JavaScript

Github issues GitHub license GitHub release Npm version


"Novemberizing config" is a library written in JavaScript that makes it easy to create, delete, read and modify configurations.

The goal of "Novemberizing config" is to support various storage and different types of configuration, making it easy to use the configuration just by changing the URL.

Class Diagram Log

The Config object supports save(), load(), get(key), set(key, value), del(key) methods. To create a Config object, simply call Config.gen({ url: ... }), specifying the URL.

const o = await Config.gen({url: "fs://./configure.json"});

console.log(o.set("hello.world", {}));
console.log(o.get("hello"));
console.log(o.del("hello"));

INSTALL

Config library can be installed using "npm".

npm install --save @novemberizing/config

USAGE

You can create an object by calling Config.gen() with a specified URL, and perform get, set, and del commands.

const o = await Config.gen({url: "fs://./configure.json"});

console.log(o.set("hello", "world"));
console.log(o.get(""));
console.log(o.del("hello"));

USE OF MEMORY SETTINGS

To use memory-based configuration, call the Config.gen() function by specifying the mem: protocol in the URL to create an object and execute commands through the created object. Memory-based settings use memory storage, so the data stored in the URL location is available only when the application is running. When the application is closed, the saved settings are no longer available.

const o = await Config.gen({ url: "mem://./configure.json" });

console.log(o.set("hello", "world"));
console.log(o.get(""));
console.log(o.del("hello"));

USE OF FILE SETTINGS

Creating file settings can also be used by specifying the protocol (fs:) in URL, just like memory settings. In the case of file settings, unlike memory settings, you can continue to use the file as long as it exists even if the application is closed.

const o = await Config.gen({ url: "fs://./configure.json" });

console.log(o.set("hello", "world"));
console.log(o.get(""));
console.log(o.del("hello"));

DOCUMENT

Novemberizing config api

0.0.16

9 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.1

10 months ago