Commit graph

70 commits

Author SHA1 Message Date
Charlie Robbins
5502f2cf98 Merge pull request #111 from martinheidegger/patch-1
Adding helpful information in case parsing failed.
2014-11-26 01:08:02 -05:00
indexzero
f07bc40d64 [fix] Fix inconsistent style from #98. 2014-11-26 01:06:44 -05:00
Charlie Robbins
d5bd26c0b6 Merge pull request #98 from joaoafrmartins/master
filter process.env by regexp
2014-11-26 01:06:11 -05:00
Charlie Robbins
c6d8f5d140 Merge pull request #79 from jfromaniello/master
Use optionally a different separator for memorystore
2014-11-26 01:04:35 -05:00
Charlie Robbins
a3404b4062 Merge pull request #76 from jmonster/usage
Resolves #64, usage and help
2014-11-26 00:59:36 -05:00
Martin Heidegger
c8b6c98c7a Adding helpful information in case parsing failed.
I stumbled over 2 slight problems of broken configuration files:

1) It said that a error in my JSON file existed (even though it was a yaml file, parsed by libyaml)
2) It didn't tell me which error occured.

both should be fixed with this PR
2014-03-09 21:40:10 +09:00
joaoafrmartins
120f5f0a4b added documentation 2014-01-10 00:26:07 +00:00
joaoafrmartins
681fd2f6b4 added regexp filtering to nconf env store 2014-01-10 00:17:52 +00:00
midknight41
6c1eb5e917 fixed white spacing and added (embarrassing absent) variable declarations 2013-10-26 20:40:12 +01:00
midknight41
29f1ca281b added support for BOM in load() and loadSync() 2013-10-03 09:17:36 +01:00
Marcin Floryan
0135d95a06 Additional error information when JSON config file cannot be read 2013-04-29 16:34:48 +01:00
José F. Romaniello
039057c730 allow different separator for memorystore 2013-04-05 15:07:33 -03:00
Johnny Domino
b73b0e1a37 attach help and showHelp arguments to the argv store 2013-02-23 12:33:23 -05:00
Johnny Domino
4894c8fcf7 resolves #64 passing usage string to optimist 2013-02-23 12:32:42 -05:00
Charlie Robbins
818526ca62 Merge pull request #63 from SchoonologyRRL/patch-1
Updated Memory.merge to handle null values
2012-12-20 22:56:54 -08:00
Michael Hart
bb57c497d3 Prefer this fix for #65 to 6045618 2012-12-20 18:12:42 -05:00
indexzero
60456186d7 [fix] Fix for #65 2012-12-20 18:03:37 -05:00
Michael Schoonmaker
ed41c51850 Updated Memory.merge to handle null values
Previously, if the Memory store was merged with an object containing a null value, the following Error occurred:

TypeError: Object.keys called on non-object
    at Function.keys (native)
    at Memory.merge (/.../node_modules/nconf/lib/nconf/stores/memory.js:199:17)
    at Memory.merge (/.../node_modules/nconf/lib/nconf/stores/memory.js:200:17)
    at Array.every (native)
    at Memory.merge (/.../node_modules/nconf/lib/nconf/stores/memory.js:199:29)
    at common.merge (/.../node_modules/nconf/lib/nconf/common.js:99:13)
    at Array.forEach (native)
    at common.merge (/.../node_modules/nconf/lib/nconf/common.js:98:22)
    at Array.forEach (native)
    at Object.common.merge (/.../node_modules/nconf/lib/nconf/common.js:97:8)

This commit prevents that.
2012-09-27 11:26:56 -07:00
Bradley Meck
683f78918c [fix] #59 root get/set should work via null/undefined as key 2012-09-07 09:29:30 -05:00
Michael Hart
9aaafc5a22 Ugh, fixed whitespace 2012-06-21 18:05:52 +10:00
Michael Hart
3c08fad1c9 Changed to as it's more accurate 2012-06-21 18:04:37 +10:00
Michael Hart
e15f787940 Updated README and allowed a simpley syntax 2012-06-21 17:18:22 +10:00
Michael Hart
8921d0502e Added support for nested configs via env 2012-06-21 16:46:10 +10:00
Christian Tellnes
83440f9956 fix spelling in error message 2012-05-24 07:27:19 +02:00
Maciej Małecki
87b0dd01c9 [minor] Use fs.exists when available
`path.exists*` was moved to `fs` module in
joyent/node@e10ed097cb.
2012-05-15 11:02:46 +02:00
Pavan Kumar Sunkara
29eb5f905d [minor] Fix whitespaces 2012-04-15 00:58:55 +05:30
Jordan Harband
6ce0b7aef3 Surfacing additional JSON.stringify arguments in formats.json.stringify, and adding the json_spacing option to the File constructor. 2012-04-13 13:22:42 -07:00
Maciej Małecki
b3699314cf [minor] Use fs.existsSync when available
`path.exists*` was moved to `fs` module in
joyent/node@e10ed097cb.
2012-03-29 13:13:16 +02:00
indexzero
6242caafda [api minor] Add .loadSync() to Memory store. Fixes #24 2012-01-02 17:20:06 -05:00
Maciej Małecki
963387cfd4 [api] File.saveSync() should return store content
Fixes #27.
2011-12-25 15:30:48 +01:00
indexzero
6c720ee109 [dist] Update Copyright and Author to Nodejitsu Inc. 2011-11-24 00:33:08 -05:00
indexzero
53d854a789 [api] Default to options if options.store is not available in nconf.Literal 2011-11-24 00:30:27 -05:00
indexzero
f4f1fdf464 [fix test] Update to respected .sources option correctly 2011-11-24 00:30:14 -05:00
indexzero
bbcb2712f1 [api fix] Dont eagerly create config files in .load() and .loadSync() 2011-11-24 00:30:11 -05:00
indexzero
16a18bffe6 [refactor] Expose all store prototypes on nconf.*. Expose store instances on Provider.stores and Provider.sources 2011-11-24 00:29:43 -05:00
indexzero
78ce55602f [minor] Dont allow .set() calls to change values in readOnly stores: argv, env, and literal 2011-11-24 00:29:35 -05:00
indexzero
c3c315d648 [refactor] Refactor to make using nconf more fluent. 2011-11-24 00:29:15 -05:00
Maciej Małecki
1b258bf5b3 [fix] Fix option parsing
See nodejitsu/forever#165.
2011-11-22 02:06:09 +01:00
Maciej Małecki
bbc5885fc1 [api] Reparse argv arguments on system.loadArgv()
It allows manipulating `process.argv` on the fly while still being able
to use nconf `System` store.
2011-11-19 01:58:08 +01:00
indexzero
2e33082f0b [api] Automatically search for a file if options.search is true in File store 2011-10-22 02:36:45 -04:00
indexzero
1ef5797e83 [api test] Finished API and tests for hierarchical configuration storage. 2011-09-18 21:37:01 -04:00
indexzero
da2da7aea8 [api test breaking refactor] Significant refactor to how nconf works. Now a fully hierarchical configuration storage mechanism capable of multiple levels of stores of the same type. 2011-09-16 06:49:47 -04:00
indexzero
2bda7b6216 [api] Added nconf.stores.System 2011-09-13 07:38:41 -04:00
indexzero
fb392ddc51 [api test] Updated test/provider-test.js and associated merge implementation 2011-08-28 08:50:26 -04:00
indexzero
a6533aa7bf [dist api test] Finished integrating features from reconf and updating associated tests 2011-08-23 06:38:51 -04:00
indexzero
add8922c04 [api dist] Begin to integrate features from reconf 2011-08-22 20:17:28 -04:00
indexzero
8620e6ba91 [api test] Remove Redis store in preparation for nconf-redis 2011-07-08 15:33:33 -04:00
indexzero
d8b5a80280 [minor] Small style updates to the File store 2011-06-24 03:31:26 -04:00
Marak Squires
c43685160d [refactor]: Cleaned up error handling on File.loadSync and File.load
[refactor]: Using path module to determine if file exists instead of throwing error
[api]: File.load and File.loadSync will now automatically create the requested JSON file path if no file is found.
2011-06-23 18:06:26 -07:00
Dominic Tarr
6c6887a850 move callback outside of try / catch
it's dangerous to callback inside try, because you may catch unexpected throws in callback.
2011-06-12 15:45:02 -07:00