Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

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