How to use the set function from nconf
Find comprehensive JavaScript nconf.set code examples handpicked from public code repositorys.
64 65 66 67 68 69 70 71 72 73
/* * Hapi server instance */ if (_.isUndefined(nconf.get('HOST'))) { nconf.set('HOST', 'localhost'); } if (_.isUndefined(nconf.get('PORT'))) { nconf.set('PORT', 1330);
0
7
3
+ 3 other calls in file
71 72 73 74 75 76 77 78 79 80
nconf.clear(key); return module.exports; }, // save // load // set: (key, value) => nconf.set(encrypt(key, true), encrypt(value)), }; function transform(data) { return {
0
3
2
67 68 69 70 71 72 73 74 75 76
if (value !== undefined) { nconf.set(prop, ['1', 1, 'true', true].includes(value)); } }); nconf.stores.env.readOnly = true; nconf.set('runJobs', nconf.get('isPrimary') && !nconf.get('jobsDisabled')); // Ensure themes_path is a full filepath nconf.set('themes_path', path.resolve(paths.baseDir, nconf.get('themes_path'))); nconf.set('core_templates_path', path.join(paths.baseDir, 'src/views'));
0
2
5
+ 50 other calls in file
GitHub: lucakiebel/NodeBB
112 113 114 115 116 117 118 119 120 121
nconf.set('isPrimary', 'true'); nconf.set('isCluster', 'false'); } // Ensure themes_path is a full filepath nconf.set('themes_path', path.resolve(__dirname, nconf.get('themes_path'))); nconf.set('core_templates_path', path.join(__dirname, 'src/views')); nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-persona/templates')); nconf.set('upload_path', path.resolve(nconf.get('base_dir'), nconf.get('upload_path')));
0
2
1
+ 15 other calls in file
GitHub: uhray/boilerplate
107 108 109 110 111 112 113 114
.argv() // overrides everything .env() // overrides config file .file({ file: __dirname + '/config/settings.json' }); nconf.set('lib', __dirname + '/app'); nconf.set('PORT', '5000'); nconf.set('HOST', '127.0.0.1'); return nconf; }
0
2
7
+ 5 other calls in file
GitHub: skygragon/leetcode-cli
87 88 89 90 91 92 93 94 95
// set try { nconf.set(argv.key, JSON.parse(argv.value)); } catch (e) { nconf.set(argv.key, JSON.parse('"' + argv.value + '"')); } return saveConfig(); };
438
0
64
+ 7 other calls in file
325 326 327 328 329 330 331 332 333 334
'nodebb-plugin-mentions', 'nodebb-plugin-dbsearch', ]; const inactivePlugin = 'nodebb-plugin-emoji'; beforeEach((done) => { nconf.set('plugins:active', activePlugins); done(); }); afterEach((done) => { nconf.set('plugins:active', undefined);
0
3
5
+ 11 other calls in file
66 67 68 69 70 71 72 73 74
clear () { logger('clear') return Promise((resolve,reject)=>{ logger('clearing') nconf.set(null, {}) nconf.save((err)=>{ if(err){ return reject(err) }
0
0
2
+ 5 other calls in file
177 178 179 180 181 182 183
} else if (file.existsSync(fallback)) { themePath = fallback; } nconf.set('theme_templates_path', themePath); nconf.set('theme_config', path.join(nconf.get('themes_path'), themeObj.id, 'theme.json')); };
0
0
13
+ 7 other calls in file