Questions tagged [nconf]

Hierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.

Hierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.

Command for installing npm i nconf

Github page

22 questions
0
votes
1 answer

WebStorm configure Mocha to accept command line options

WebStorm Run-'Edit Configuration' is set up to run Mocha test. The Mocha Javascript test code accepts nconf command line arguments for e.g. --user='production' How can 'Edit Configuration' for Mocha test be set up to accept the nconf command line…
SUM
  • 1,651
  • 4
  • 33
  • 57
0
votes
0 answers

nconf not loading file synchronously

Trying to use nconf to load a file into memory and use that for configuration. However, every time I call nconf.get it returns undefined leading me to believe I'm being dealt an async function. The path I'm using seems correct. I noticed the…
Breedly
  • 12,838
  • 13
  • 59
  • 83
0
votes
1 answer

How to define default value for nconf globaly?

I'm trying to put my development project live. So to handle config I'll use nconf. I have defined on heroku my config var : NODE_ENV: production And I have a config object on dev: config = { NODE_ENV: development } On the app.js file, I require…
Arthur
  • 4,870
  • 3
  • 32
  • 57
0
votes
0 answers

How to put nconf property inside a Javascript object

I am loading config.json file using nconf like below: nconf.file({ file: '../config.json' }); . I am using a property in that config file which I can print on console and it works: console.log('mailhost: '+ nconf.get('mailhost')); But my…
sunny_dev
  • 765
  • 3
  • 15
  • 34
0
votes
1 answer

Getting error trying to read a json file with babel/register module

this is my config file: import nconf from "nconf"; import path from "path"; nconf.argv() .env() .file({ file: path.join( __dirname, `manifest.${process.env['NODE_ENV'] || 'development'}.json` …
Mazzy
  • 13,354
  • 43
  • 126
  • 207
0
votes
1 answer

nconf is not working with NPM start command

I have these two node.js command line commands: $ NODE_ENV=dev_local npm start --fp data_for_testing/csvfile.csv --mptp map_ivr_itg $ NODE_ENV=dev_local node start_script --fp data_for_testing/csvfile.csv --mptp map_ivr_itg I am using nconf the…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

How do I have a namespace in file?

This JSON within a file cannot be parsed: { "facebook": { appId: "myAppId", appSecret: "myAppSecret" } } When I use this: { "facebook:appId": "myAppId", "facebook:appSecret": "myAppSecret" } ...the following both return null... var…
Ian Warburton
  • 15,170
  • 23
  • 107
  • 189
1
2