0.0.2 • Published 3 years ago

@idsync/config v0.0.2

Weekly downloads
35
License
MIT
Repository
github
Last release
3 years ago

Config

Configuration utility

Installation

Run npm install @idsync/config --save to install and save the library.

Usage

Configuring idsync entities is easy:

const { Archive } = require("idsync");
const { configureIdsync } = require("@idsync/config");

const archive = Archive.createWithDefaults();
const config = configureIdsync(archive);
config.set("test.value", 123);
config.apply();

Use the configureIdsync(entity) method to configure instances, and use the config#apply() method to apply the configuration (write it to the instance). Idsync configurations are stored using attribute values.

Objects are written in a nested manner, whilst arrays are written directly. This means that objects can be composed and merged (especially during merge conflicts), but arrays are overwritten (including nested objects). It is therefore advised to keep configurations simple: Use nestedness sparingly and expect that arrays will never be merged.