clean-config
A quick package to load config files in a simple & clean way.
Versions
- 2.2.0, 2020-08-19, AMV : Hacked out new MagicMap features, but didn’t doc it yet.
- 2.1.0, 2020-08-18, AMV : Added KEY swaps, but didn’t doc it yet.
- 2.0.2, 2020-08-17, AMV : Changed to brackets for keys, and fixed comments to longer clash with URLs.
- 1.0.1, 2020-06-24, AMV : First publish.
Usage
Here’s an example of a config file’s syntax:
// This is a comment line.
[SomeKey1] Here is a value to assign to SomeKey.
[AnotherKey2] Here's a value to assign to a different key.
Loading that file in using clean-config
returns:
And here’s how to use the package:
const cleanConfig = ; // Basic transforms between Text and ConfigObject:const cfg = cleanConfig;const txt = cleanConfig; // FS helpers:const cfg = cleanConfig;const cfg = ; // short syntaxcleanConfig;