2.1.1 • Published 8 years ago

quture-config v2.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
8 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

8 years ago

2.1.0

8 years ago

2.0.9

8 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago