nconf icon indicating copy to clipboard operation
nconf copied to clipboard

Error on load() when config file doesn't exist

Open coolhouse opened this issue 12 years ago • 5 comments

Just getting started with this module, cool stuff. It would be nice if load() would return something in err if the config file wasn't found. I can check for existence before I call load(), but this is redundant. Or if I'm missing something being a noob, please inform. My prototype is trying to load config, if it doesn't exist (initial startup, for example) create a default.

coolhouse avatar Jan 12 '13 15:01 coolhouse

+1

davidcl64 avatar Apr 19 '13 16:04 davidcl64

+1 !! I burnt a bunch of time on this. Expected an unfound file to throw an error so thought I was doing something else wrong, very annoying.

atomless avatar May 10 '13 18:05 atomless

+1

psiphi75 avatar Jul 03 '13 23:07 psiphi75

+1

empierre avatar Apr 20 '16 07:04 empierre

There's example code here: https://thejsf.wordpress.com/2015/02/08/node-js-application-configuration-with-nconf/ for failing noisily.

Wilfred avatar Sep 08 '16 17:09 Wilfred