settns
v0.0.1
Published
environment-based, nested, addressable settings with modular pre-definable defaults
Downloads
1
Readme
console.log(settns("ship.registry-number")); > "NCC-1701"
settns("ship.registry-number", "NCC-1701-A");
console.log(settns("ship.name")); > "Enterprise"
console.log(settns("ship.registry-number")); > "NCC-1701-A"
console.log(settns.environment()); > "search for spock"
settns("ship.registry-number", "NCC-1701");
settns.environment("voyage home"); settns("ship.registry-number", "NCC-1701-A");
settns.environment("search for spock");
console.log(settns("ship.registry-number")); > "NCC-1701"
settns.environment("voyage home");
console.log(settns("ship.registry-number")); > "NCC-1701-A"
console.log(settns.environment()); > "voyage home"
console.log(settns("ship.registry-number")); > "NCC-1701-A"
settns.environment("next generation");
console.log(setns("ship.registry-number")); > "NCC-1701-D"
settns.default({ "server": { "port": 3000, "hostname": "example" } });
settns.environment("development", { "server.alias": ["localhost", "127.0.0.1"] });
settns.environment("production", { "server": { "port": 80, "hostname": "example.com", "alias": ["www.example.com"] } });