From de551d42ecabff5464c8de1ef958b73a5d04bd44 Mon Sep 17 00:00:00 2001 From: Mark Oberemk Date: Wed, 27 Jan 2016 12:29:26 -0500 Subject: [PATCH] Update README.md Add basic documentation explaining the `nconf.required` method --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 8a73170..41be848 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,18 @@ Removes the store with the specified `name.` The configuration stored at that le ``` js nconf.remove('file'); +```y + +### nconf.required(keys) +Declares a set of string keys to be mandatory, and throw an error if any are missing. + +```js + nconf.defaults({ + keya: 'a', + }); + + nconf.required(['keya', 'keyb']); + // Error: Missing required keys: keyb ``` ## Storage Engines