2.1.1 • Published 7 years ago

quture-config v2.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

quture-config

A package to load configuration options


Introduction

The package exports a class that can be instantiated to read configuration files from any directory. Documentation can be found here.

Basic usage

const path = require('path');
const config = require('quture-config')({
  configDir: path.join(__dirname, 'config')
});
//
//  ./config/app.js
//        module.exports = {
//          someValue: 'hello world!'
//        }
let hasSomeValue = config.has('app.someValue');

if (hasSomeValue) {
  // true
} else {
  // false
}
let actualSomeValue = config.get('app.someValue');
console.log(actualSomeValue);

// 'hello world!'
let valueThatDoesntExist = config.get('app.valueThatDoesntExist', 'This will be returned as the default value instead');
console.log(valueThatDoesntExist);

// 'This will be returned as the default value instead'
let valueThatReallyDoesntExist = config.get('app.valueThatDoesntExist');
console.log(valueThatReallyDoesntExist);

// null
2.1.1

7 years ago

2.1.0

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago