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
17
votes
3 answers

Capturing command line arguments using NCONF

I have a simple node.js backend script and I want to capture command line arguments along with the keys/values from a config.json file and environment variables. The second two I am having no problem with, but I am having nearly inexplicable trouble…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
12
votes
2 answers

What is package-lock.json?

Is there any kind-teacher can answer my question above? FYI I'm using WebStorm and making with node.js I installed npm module like nconf and package-lock.json has made. I expected package.json would've been made. Thank you.
jinuman
  • 195
  • 1
  • 8
7
votes
1 answer

How can I pass a hierarchical config value to nconf on command line?

Colons separate nconf hierarchies, e.g., { "AUTH": { "ENABLED": true } } is accessed via: nconf.get("AUTH:ENABLED"); I'd like to override this via environment and/or command line options under npm start, e.g., AUTH:ENABLED=false npm…
Dave Newton
  • 158,873
  • 26
  • 254
  • 302
3
votes
0 answers

Export configuration data from module

I want to use the nconf module to retriever configuration data from a file(s) according to a policy and export the properties in the JSON configuration files as a module like so: import * as config from…
Nathan
  • 835
  • 3
  • 11
  • 20
3
votes
3 answers

Can't load configuration json file using nconf

I'm trying to follow the example here: https://www.npmjs.com/package/nconf What I'm trying to do is load a configuration json file using nconf, but I can't seem to actually retrieve any of the configs. I've exported this to another file, but I've…
Randy Song
  • 574
  • 1
  • 7
  • 22
3
votes
1 answer

nconf.js like gem for ruby configuration

I'm building a cli tool in ruby, and I need to take config from different sources: environment variable, dotfile, arguments or hardcoded values. (with a precedence system) In node.js I would have used nconf.js, to do this. Is there some…
AdrieanKhisbe
  • 3,899
  • 8
  • 37
  • 45
3
votes
1 answer

Using nconf in the browser?

I'm looking to use https://github.com/flatiron/nconf in the browser. I have tried to use it with browserify but because nconf calls fs.readdirSync when it is required to scan directories for configuration, it fails in the browser. // config.js 'use…
Paul
  • 4,422
  • 5
  • 29
  • 55
2
votes
1 answer

Extending a typescript variable declaration

I want to use the nconf-yaml plugin with my Typescript project, but I don't know how to add it in my typings. In @types/nconf, the formats variable is declared as below: export declare var formats: { json: IFormat; ini: IFormat; }; How do I…
yoneal
  • 313
  • 1
  • 10
1
vote
0 answers

Why does claudia.js fail package validation when using nconf in a specific way?

I am using nconf in a NodeJS project, which I want to deploy to AWS Lambda using claudia.js. I have followed this example: const path = require('path'); const nconf = require('nconf'); function Configuration(){ nconf.argv().env({ lowerCase:…
reikje
  • 2,850
  • 2
  • 24
  • 44
1
vote
1 answer

How to read Heroku's nested process.env vars / object in nconf?

I'm trying to deploy Ghost 1.2.0 to Heroku. With previous versions of Ghost (<= 0.11.x), they used a config.js file where you could just do: database: { client: 'postgres', connection: { host: process.env.POSTGRES_HOST, …
Jordi Nebot
  • 3,355
  • 3
  • 27
  • 56
1
vote
2 answers

Attaching object to Node.js process

I am using the environment variable and arguments parsing module called nconf for my node.js Express web server. https://github.com/indexzero/nconf I decided that the best way to make the nconf data global was to simply attach it to the process…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
0 answers

nconf returns undefined if dependency linked with npm link

I have two projects. Let's say: Project A, Project B Project B is a dependent module in Project A When we do npm start i.e. start the server for Project A, the nconf gets initialized with development env files succesfully and returns all the related…
Vishal Singh
  • 349
  • 3
  • 8
0
votes
1 answer

How to properly deploy node apps to GAE with secret keys?

I am exploring GAE with nconf and I'm wondering if the following setup is secured after I deploy an App. What concerns me is are both my "config.dev.json" and "config.prod.json" files deployed despite including them in ".gitignore". I am unsure…
user3015876
  • 143
  • 7
0
votes
1 answer

How to use a config file for Unit Test and another for production in NODE

I have a value in config file which is used in an IF condition and once that value is set I am not able to get the minimum coverage required. As work around I created two json files one is production.json and other is test.json and I want to use…
jack
  • 321
  • 1
  • 5
  • 20
0
votes
1 answer

Icinga2 check_by_ssh

I would migrate from Nagios to Icinga2. I would try to migrate one my custom command that works in Nagios but i can't translate in Icinga. I would create one my custom "object CheckCommand" to use in some hosts. In nagios I have this (and still work…
barbatrukko
  • 51
  • 1
  • 3
1
2