Skip to content

Commit

Permalink
Update README to mention that get() throws excewptions, and also `con…
Browse files Browse the repository at this point in the history
…fig.has()`. Addresses #173.

These are important and common details to encounter, and worth mentioning up front.
  • Loading branch information
markstos committed Nov 19, 2014
1 parent 68e8485 commit 1bd0bca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions History.md
@@ -1,4 +1,8 @@


* Highlight `config.has()` in the README. Use it to check to if a value exists, since `config.get()`
throws exceptions on undefined values. (@markstos)

1.8.1 / 2014-11-14
==================

Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -77,6 +77,14 @@ The following examples are in JSON format, but configurations can be in other [f
var dbConfig = config.get('Customer.dbConfig');
db.connect(dbConfig, ...);

if (config.has('optionalFeature.detail')) {
var detail = config.get('optionalFeature.detail');
...
}

`config.get()` will throw an exception for undefined keys to help catch typos and missing values.
Use `config.has()` to test if a configuration value is defined.

**Start your app server:**

$ export NODE_ENV=production
Expand Down

0 comments on commit 1bd0bca

Please sign in to comment.