How to use the @awesomeeng/awesome-config.three function in @awesomeeng/awesome-config

To help you get started, we’ve selected a few @awesomeeng/awesome-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awesomeeng / awesome-config / examples / AddFiles / entry.js View on Github external
config().init();

// Add a file
config().add("./config.cfg");

// Add another file
config().add("./evens.cfg");

// start config
config().start();

// test
const assert = require("assert");
assert.equal(config.one,1);
assert.equal(config.two,"even");
assert.equal(config.three,3);
assert.equal(config.four,"even");
assert.equal(config.five,5);
assert.equal(config.six,"even");
assert.equal(config.seven,7);
assert.equal(config.eight,"even");

// print out config for deeper understanding...
console.log(config().toString());
github awesomeeng / awesome-config / examples / AddDirectory / entry.js View on Github external
// Initialize it to create our scope
config().init();

// Add a directory.  This will in turn add config.cfg, evens.cfg, and odds.cfg
config().add("./");

// start config
config().start();

// test
const assert = require("assert");
assert.strictEqual(config.zero,0);
assert.strictEqual(config.one,"odd");
assert.strictEqual(config.two,"even");
assert.strictEqual(config.three,"odd");
assert.strictEqual(config.four,"even");
assert.strictEqual(config.five,"odd");
assert.strictEqual(config.six,"even");
assert.strictEqual(config.seven,"odd");
assert.strictEqual(config.eight,"even");
assert.strictEqual(config.nine,"odd");
assert.strictEqual(config().sources.length,3);

// print out config for deeper understanding...
console.log(config().sources);
// console.log(config().toString());
github awesomeeng / awesome-config / examples / Namespaces / module2.js View on Github external
// (c) 2018, The Awesome Engineering Company, https://awesomeneg.com

"use strict";

// require AwesomeConfig
const config = require("@awesomeeng/awesome-config");

// test
const assert = require("assert");
assert.equal(config.one,"GLOBAL 1");
assert.equal(config.two,"GLOBAL 2");
assert.equal(config.three,"GLOBAL 3");

// print out config for deeper understanding...
console.log("MODULE2 config (which should be the same as GLOBAL config)...");
console.log(config().toString());
console.log();
github awesomeeng / awesome-config / examples / Namespaces / entry.js View on Github external
// Add some config
config().add({
	one: "GLOBAL 1",
	two: "GLOBAL 2",
	three: "GLOBAL 3"
});

// start config
config().start();

// test
const assert = require("assert");
assert.equal(config.one,"GLOBAL 1");
assert.equal(config.two,"GLOBAL 2");
assert.equal(config.three,"GLOBAL 3");

// print out config for deeper understanding...
console.log("GLOBAL config...");
console.log(config().toString());
console.log();

// require module 1
require("./module1");

// require module 2
require("./module2");

// require module 2
require("./module3");

@awesomeeng/awesome-config

AwesomeConfig is a powerful configuration system for building enterprise node.js application. It provides a unified transparent configuration object to your application based on configuration files or objects that you define. It includes support for cond

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis