typeconf

node v9.11.2
version: 0.6.1
endpointsharetweet
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());
Loading…

no comments

    sign in to comment