From 042b24c2897a5c243de0d4bce3a75f202b2d4cc8 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Wed, 25 Jan 2017 11:17:41 -0500 Subject: [PATCH] added section on validation --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4461f99..e63c237 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,10 @@ PELIAS_CONFIG=/path/config.json \ node -e "console.log( require('pelias-config').generate().stringify() );"; ``` +### Validation + +Aside from `deep`, the `generate` function takes an additional parameter named `schema` that uses [Joi](https://www.npmjs.com/package/joi) to validate that the configuration is useable. An error is thrown if the generated configuration does not validate against the schema. + ### Exporting & Debugging The generated config will be a [mergeable](https://github.com/pelias/mergeable) object: