require('minimist')
const fs = require('fs');
const TypeConf = require('typeconf').default;
fs.writeFileSync('./conf.json', JSON.stringify({
typeconfIsCool: true
}));
const conf = new TypeConf()
.withEnv('PREFIX')
.withArgv()
.withFile('./conf.json')
.withStore({
example: 'value'
})
.withSupplier((key) => ({
life: '42'
}[key]))
.set('items', ['apples', 'oranges', 'pears']);
console.log(conf.getString('example'));
console.log(conf.getNumber('life'));
console.log(conf.getObject('items'));
console.log(conf.getBoolean('typeconfIsCool'));
console.log(conf.toJSON());